Модуль:Meals Lookup: различия между версиями

Нет описания правки
Нет описания правки
Строка 374: Строка 374:
function p.buildrecipeboxuniversal(frame, idtable)
function p.buildrecipeboxuniversal(frame, idtable)
     local out = "startd\n"
     local out = "startd\n"
     for type, ids in pairs(idtable) do
     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(ids) == nil then
         if type == "microwaveRecipes" and not next(recipes) == nil then
             do
             do
                 for id in pairs(ids) do
                 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(ids) == nil then
         elseif type == "mixableRecipes" and not next(recipes) == nil then
             do
             do
                 for id in pairs(ids) do
                 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(ids) == nil then
         elseif type == "sliceableRecipes" and not next(recipes) == nil then
             do
             do
                 for id in pairs(ids) do
                 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(ids) == nil then
         elseif type == "grindableRecipes" and not next(recipes) == nil then
             do
             do
                 for id in pairs(ids) do
                 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(ids) == nil then
         elseif type == "heatableRecipes" and not next(recipes) == nil then
             do
             do
                 for id in pairs(ids) do
                 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(ids) == nil then
         elseif type == "toolmadeRecipes" and not next(recipes) == nil then
             do
             do
                 for id in pairs(ids) do
                 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 .. patt .. "\n"
         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