Модуль:Meals Lookup: различия между версиями
Mhamster (обсуждение | вклад) Нет описания правки |
Mhamster (обсуждение | вклад) Нет описания правки |
||
| Строка 39: | Строка 39: | ||
local out = "" | local out = "" | ||
for item, amount in pairs(array) do | for item, amount in pairs(array) do | ||
out = out .. frame:preprocess( "{{Chem Recipe Component|reagent=".. item .."|amount={{{"..amount.."|1}}}}}" ) | out = out .. frame:preprocess( "{{Chem Recipe Component|reagent=".. item .."|amount={{{"..amount.."|1}}}}}" ) | ||
end | end | ||
| Строка 103: | Строка 102: | ||
local id = frame.args[1]:gsub(' ', '') | local id = frame.args[1]:gsub(' ', '') | ||
local recipe = getrecipe(frame, "grindableRecipes", id) | local recipe = getrecipe(frame, "grindableRecipes", id) | ||
local | local reagents = buildreagents(frame, recipe["result"]) | ||
out = frame:preprocess("{{Recipe Box".. | out = frame:preprocess("{{Recipe Box".. | ||
"|name={{#invoke:Entity Lookup|getname|".. recipe["result"] .."}}".. | "|name={{#invoke:Entity Lookup|getname|".. recipe["result"] .."}}".. | ||
"|component-1="..frame:preprocess("{{Recipe Component|item={{#invoke:Entity Lookup|getname|".. recipe["input"] .."}}|image=Файл:Mousegif.gif}}" ) .. | "|component-1="..frame:preprocess("{{Recipe Component|item={{#invoke:Entity Lookup|getname|".. recipe["input"] .."}}|image=Файл:Mousegif.gif}}" ) .. | ||
"|transformer={{Recipe Transformers|grindableRecipes}}".. | "|transformer={{Recipe Transformers|grindableRecipes}}".. | ||
"|result=".. | "|result=".. reagents .. | ||
"}}") | "}}") | ||
return out | return out | ||