Модуль:Meals Lookup: различия между версиями
Mhamster (обсуждение | вклад) Нет описания правки |
Mhamster (обсуждение | вклад) Нет описания правки |
||
| Строка 26: | Строка 26: | ||
end | end | ||
return false | return false | ||
end | |||
function table.length(table) | |||
local out = 0 | |||
for _ in table do | |||
out = out + 1 | |||
end | |||
return out | |||
end | end | ||
function table.isempty(table) | function table.isempty(table) | ||
local count = | local count = table.length(table) | ||
if count == 0 then | if count == 0 then | ||
do | do | ||
| Строка 494: | Строка 499: | ||
for _, patt in pairs(frame.args) do | for _, patt in pairs(frame.args) do | ||
local ids = getrecipesbyname(frame, tablo, patt) | local ids = getrecipesbyname(frame, tablo, patt) | ||
out = out .. table.length(ids) | |||
for type, recipes in pairs(ids) do | for type, recipes in pairs(ids) do | ||
for n, recipe in pairs(recipes) do | for n, recipe in pairs(recipes) do | ||