Модуль:Meals Lookup: различия между версиями
Mhamster (обсуждение | вклад) Нет описания правки |
Mhamster (обсуждение | вклад) Нет описания правки |
||
| Строка 11: | Строка 11: | ||
function p.getrecipe(frame, type, id) | function p.getrecipe(frame, type, id) | ||
return p.getrecipesfromtype(frame, type)[id] | return p.getrecipesfromtype(frame, type)[id:gsub(' ', '')] | ||
end | end | ||
| Строка 49: | Строка 49: | ||
end | end | ||
function p.buildmicrowaverecipebox(frame | function p.buildmicrowaverecipebox(frame) | ||
local out = "hehe" | local out = "hehe" | ||
local id = | local id = frame.args[1]:gsub(' ', '') | ||
local recipe = p.getrecipe(frame, "microwaveRecipes", id) | local recipe = p.getrecipe(frame, "microwaveRecipes", id) | ||
local solids = p.buildsolids(frame, p.getmicrowaverecipesolids(frame, recipe)) | local solids = p.buildsolids(frame, p.getmicrowaverecipesolids(frame, recipe)) | ||
| Строка 90: | Строка 88: | ||
out = out .. p.buildsolids(frame, p.getmicrowaverecipesolids(frame, p.getrecipe(frame, frame.args[2], frame.args[1]))) | out = out .. p.buildsolids(frame, p.getmicrowaverecipesolids(frame, p.getrecipe(frame, frame.args[2], frame.args[1]))) | ||
out = out .. "\n" .. p.buildreagents(frame, p.getmicrowaverecipereagents(frame, p.getrecipe(frame, frame.args[2], frame.args[1]))) | out = out .. "\n" .. p.buildreagents(frame, p.getmicrowaverecipereagents(frame, p.getrecipe(frame, frame.args[2], frame.args[1]))) | ||
out = out .. "\n" .. | out = out .. "\n" .. frame:preprocess("{{#invoke:Meals Lookup|buildmicrowaverecipebox|".. frame.args[1] .. "}}") | ||
-- out = out .. p.buildmicrowaverecipebox(frame, frame.args[1]) | -- out = out .. p.buildmicrowaverecipebox(frame, frame.args[1]) | ||
return out | return out | ||