Модуль:Meals Lookup: различия между версиями
Mhamster (обсуждение | вклад) Нет описания правки |
Mhamster (обсуждение | вклад) Нет описания правки |
||
| Строка 374: | Строка 374: | ||
function p.buildrecipeboxuniversal(frame, idtable) | function p.buildrecipeboxuniversal(frame, idtable) | ||
local out = "startd\n" | local out = "startd\n" | ||
for type, | for type, recipes in pairs(idtable) do | ||
-- INTRUDER ALERT: SHITCODE IS IN THE BASE | -- INTRUDER ALERT: SHITCODE IS IN THE BASE | ||
if type == "microwaveRecipes" and not next( | if type == "microwaveRecipes" and not next(recipes) == nil then | ||
do | do | ||
for id in pairs( | for id, _ in pairs(recipes) do | ||
out = out .. id | out = out .. id | ||
out = out .. frame:preprocess("{{#invoke:Meals Lookup|buildmicrowaverecipebox|" .. id .. "}}") .. "\n" | out = out .. frame:preprocess("{{#invoke:Meals Lookup|buildmicrowaverecipebox|" .. id .. "}}") .. "\n" | ||
end | end | ||
end | end | ||
elseif type == "mixableRecipes" and not next( | elseif type == "mixableRecipes" and not next(recipes) == nil then | ||
do | do | ||
for id in pairs( | for id, _ in pairs(recipes) do | ||
out = out .. id | out = out .. id | ||
out = out .. frame:preprocess("{{#invoke:Meals Lookup|buildmixablerecipebox|" .. id .. "}}") .. "\n" | out = out .. frame:preprocess("{{#invoke:Meals Lookup|buildmixablerecipebox|" .. id .. "}}") .. "\n" | ||
end | end | ||
end | end | ||
elseif type == "sliceableRecipes" and not next( | elseif type == "sliceableRecipes" and not next(recipes) == nil then | ||
do | do | ||
for id in pairs( | for id, _ in pairs(recipes) do | ||
out = out .. id | out = out .. id | ||
out = out .. frame:preprocess("{{#invoke:Meals Lookup|buildslicerecipebox|" .. id .. "}}") .. "\n" | out = out .. frame:preprocess("{{#invoke:Meals Lookup|buildslicerecipebox|" .. id .. "}}") .. "\n" | ||
end | end | ||
end | end | ||
elseif type == "grindableRecipes" and not next( | elseif type == "grindableRecipes" and not next(recipes) == nil then | ||
do | do | ||
for id in pairs( | for id, _ in pairs(recipes) do | ||
out = out .. id | out = out .. id | ||
out = out .. frame:preprocess("{{#invoke:Meals Lookup|buildgrindrecipebox|" .. id .. "}}") .. "\n" | out = out .. frame:preprocess("{{#invoke:Meals Lookup|buildgrindrecipebox|" .. id .. "}}") .. "\n" | ||
end | end | ||
end | end | ||
elseif type == "heatableRecipes" and not next( | elseif type == "heatableRecipes" and not next(recipes) == nil then | ||
do | do | ||
for id in pairs( | for id, _ in pairs(recipes) do | ||
out = out .. id | out = out .. id | ||
out = out .. frame:preprocess("{{#invoke:Meals Lookup|buildheatrecipebox|" .. id .. "}}") .. "\n" | out = out .. frame:preprocess("{{#invoke:Meals Lookup|buildheatrecipebox|" .. id .. "}}") .. "\n" | ||
end | end | ||
end | end | ||
elseif type == "toolmadeRecipes" and not next( | elseif type == "toolmadeRecipes" and not next(recipes) == nil then | ||
do | do | ||
for id in pairs( | for id, _ in pairs(recipes) do | ||
out = out .. id | out = out .. id | ||
out = out .. frame:preprocess("{{#invoke:Meals Lookup|buildtoolmaderecipebox|" .. id .. "}}") .. "\n" | out = out .. frame:preprocess("{{#invoke:Meals Lookup|buildtoolmaderecipebox|" .. id .. "}}") .. "\n" | ||
| Строка 468: | Строка 468: | ||
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 .. | for k, v in pairs(ids) do | ||
out = out .. k .. "\n" | |||
end | |||
out = out .. p.buildrecipeboxuniversal(frame, ids) | out = out .. p.buildrecipeboxuniversal(frame, ids) | ||
end | end | ||