Модуль:Meals Lookup: различия между версиями
Mhamster (обсуждение | вклад) Нет описания правки |
Mhamster (обсуждение | вклад) toolmade |
||
| Строка 31: | Строка 31: | ||
local out = "" | local out = "" | ||
for solid, amount in pairs(array) do | for solid, amount in pairs(array) do | ||
out = out .. frame:preprocess( "{{Recipe Component|item={{#invoke:Entity Lookup|getname|".. solid .."}}|image= | out = out .. frame:preprocess( "{{Recipe Component|item={{#invoke:Entity Lookup|getname|".. solid .."}}|image=File:Mousegif.gif|amount=".. amount .."}}" ) | ||
end | end | ||
return out | return out | ||
| Строка 73: | Строка 73: | ||
"|component-1="..solids .. "\n" .. reagents.. | "|component-1="..solids .. "\n" .. reagents.. | ||
"|transformer={{Recipe Transformers|microwaveRecipes|"..recipe["time"].."}}".. | "|transformer={{Recipe Transformers|microwaveRecipes|"..recipe["time"].."}}".. | ||
"|result=".. frame:preprocess("{{Recipe Component|item={{#invoke:Entity Lookup|getname|".. recipe["result"] .."}}|image= | "|result=".. frame:preprocess("{{Recipe Component|item={{#invoke:Entity Lookup|getname|".. recipe["result"] .."}}|image=File:Mousegif.gif}}" ) .. | ||
"}}") | "}}") | ||
return out | return out | ||
| Строка 87: | Строка 87: | ||
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= | "|component-1="..frame:preprocess("{{Recipe Component|item={{#invoke:Entity Lookup|getname|".. recipe["input"] .."}}|image=File:Mousegif.gif}}" ) .. | ||
"|transformer={{Recipe Transformers|sliceableRecipes}}".. | "|transformer={{Recipe Transformers|sliceableRecipes}}".. | ||
"|result=".. frame:preprocess("{{Recipe Component|item={{#invoke:Entity Lookup|getname|".. recipe["result"] .."}}|image= | "|result=".. frame:preprocess("{{Recipe Component|item={{#invoke:Entity Lookup|getname|".. recipe["result"] .."}}|image=File:Mousegif.gif|amount="..recipe["count"].."}}" ) .. | ||
"}}") | "}}") | ||
return out | return out | ||
| Строка 98: | Строка 98: | ||
--#region grindableRecipes | --#region grindableRecipes | ||
function p.buildgrindrecipebox(frame) -- {{#invoke:Meals Lookup| | function p.buildgrindrecipebox(frame) -- {{#invoke:Meals Lookup|buildgrindrecipebox|SliceableRecipeID}} | ||
local out = "" | local out = "" | ||
local id = frame.args[1]:gsub(' ', '') | local id = frame.args[1]:gsub(' ', '') | ||
| Строка 105: | Строка 105: | ||
out = frame:preprocess("{{Recipe Box".. | out = frame:preprocess("{{Recipe Box".. | ||
"|name={{#invoke:Entity Lookup|getname|".. recipe["id"] .."}}".. | "|name={{#invoke:Entity Lookup|getname|".. recipe["id"] .."}}".. | ||
"|component-1="..frame:preprocess("{{Recipe Component|item={{#invoke:Entity Lookup|getname|".. recipe["input"] .."}}|image= | "|component-1="..frame:preprocess("{{Recipe Component|item={{#invoke:Entity Lookup|getname|".. recipe["input"] .."}}|image=File:Mousegif.gif}}" ) .. | ||
"|transformer={{Recipe Transformers|grindableRecipes}}".. | "|transformer={{Recipe Transformers|grindableRecipes}}".. | ||
"|result=".. reagents .. | "|result=".. reagents .. | ||
| Строка 113: | Строка 113: | ||
--#endregion grindableRecipes | --#endregion grindableRecipes | ||
--#region heatableRecipes | |||
function p.buildheatrecipebox(frame) -- {{#invoke:Meals Lookup|buildheatrecipebox|SliceableRecipeID}} | |||
local out = "" | |||
local id = frame.args[1]:gsub(' ', '') | |||
local recipe = getrecipe(frame, "heatableRecipes", id) | |||
out = frame:preprocess("{{Recipe Box".. | |||
"|name={{#invoke:Entity Lookup|getname|".. recipe["id"] .."}}".. | |||
"|component-1="..frame:preprocess("{{Recipe Component|item={{#invoke:Entity Lookup|getname|".. recipe["input"] .."}}|image=File:Mousegif.gif}}" ) .. | |||
"|transformer={{Recipe Transformers|heatableRecipes|".. recipe["minTemp"] .."}}".. | |||
"|result=".. frame:preprocess("{{Recipe Component|item={{#invoke:Entity Lookup|getname|".. recipe["result"] .."}}|image=File:Mousegif.gif}}" ).. | |||
"}}") | |||
return out | |||
end | |||
--#endregion heatableRecipes | |||
--#region heatableRecipes | |||
function p.buildtoolmaderecipebox(frame) -- {{#invoke:Meals Lookup|buildtoolmaderecipebox|SliceableRecipeID}} | |||
local out = "" | |||
local id = frame.args[1]:gsub(' ', '') | |||
local recipe = getrecipe(frame, "toolmadeRecipes", id) | |||
local transformer = "toolmadeRecipes" .. recipe["tool"] | |||
out = frame:preprocess("{{Recipe Box".. | |||
"|name={{#invoke:Entity Lookup|getname|".. recipe["id"] .."}}".. | |||
"|component-1="..frame:preprocess("{{Recipe Component|item={{#invoke:Entity Lookup|getname|".. recipe["input"] .."}}|image=File:Mousegif.gif}}" ) .. | |||
"|transformer={{Recipe Transformers|".. transformer .."}}".. | |||
"|result=".. frame:preprocess("{{Recipe Component|item={{#invoke:Entity Lookup|getname|".. recipe["result"] .."}}|image=File:Mousegif.gif}}" ).. | |||
"}}") | |||
return out | |||
end | |||
--#endregion heatableRecipes | |||
-- tests. | -- tests. | ||
| Строка 120: | Строка 156: | ||
out = out .. "\n" .. frame:preprocess("{{#invoke:Meals Lookup|buildslicerecipebox|".. frame.args[2] .. "}}") | out = out .. "\n" .. frame:preprocess("{{#invoke:Meals Lookup|buildslicerecipebox|".. frame.args[2] .. "}}") | ||
out = out .. "\n" .. frame:preprocess("{{#invoke:Meals Lookup|buildgrindrecipebox|".. frame.args[3] .. "}}") | out = out .. "\n" .. frame:preprocess("{{#invoke:Meals Lookup|buildgrindrecipebox|".. frame.args[3] .. "}}") | ||
out = out .. "\n" .. frame:preprocess("{{#invoke:Meals Lookup|buildheatrecipebox|".. frame.args[4] .. "}}") | |||
out = out .. "\n" .. frame:preprocess("{{#invoke:Meals Lookup|buildtoolmaderecipebox|".. frame.args[5] .. "}}") | |||
return out | return out | ||
end | end | ||
return p | return p | ||