Module:Infobox Recipe: Difference between revisions

Jump to navigation Jump to search
Content added Content deleted
(Copy of Recipe Infobox from Sandbox/User:The_Gaffer/Modules/Infobox Recipe to replace existing Infobox Recipe Implementation)
 
No edit summary
Line 23: Line 23:
--get the value for the output product
--get the value for the output product
local output1Value = args.output1 and mw.smw.ask('[[:+]][[' .. args.output1 .. ']]|?Value|limit=1')
local output1Value = args.output1 and mw.smw.ask('[[:+]][[' .. args.output1 .. ']]|?Value|limit=1')
local output1TotalValue = output1Value[1]['Value'] * (tonumber(args.output1qty) or 1)
local output1TotalValue
if output1Value ~= nil then
output1TotalValue = output1Value[1]['Value'] * (tonumber(args.output1qty) or 1)
else
output1TotalValue = 0
end
--Check if any of the raw mats provided are intermediate products, if they are, return their own raw materials
--Check if any of the raw mats provided are intermediate products, if they are, return their own raw materials