Модуль:Meals Lookup: различия между версиями
Mhamster (обсуждение | вклад) Нет описания правки |
Mhamster (обсуждение | вклад) Нет описания правки |
||
| Строка 71: | Строка 71: | ||
local out = {} | local out = {} | ||
for type, recipes in pairs(p.meals) do | for type, recipes in pairs(p.meals) do | ||
out[type]= {} | |||
for recipeId, recipe in pairs(recipes) do | for recipeId, recipe in pairs(recipes) do | ||
if string.match(recipeId, str) then | if string.match(recipeId, str) then | ||
table.insert(out, recipe) | table.insert(out[type], recipe) | ||
end | end | ||
end | end | ||
| Строка 335: | Строка 336: | ||
function p.tests(frame) | function p.tests(frame) | ||
local out = "" | local out = "" | ||
for type, recipes in pairs(getrecipesbyname(frame, "[Ss]oup")) do | |||
for | for k, r in pairs(recipes) do | ||
out = out .. " " .. k .. r["id"] | out = out .. " " .. k .. ":" .. r["id"] | ||
end | |||
end | end | ||
return out | return out | ||