Module:Infobox Recipe: Difference between revisions
no edit summary
The Gaffer (talk | contribs) No edit summary |
The Gaffer (talk | contribs) No edit summary |
||
Line 13:
--Get each of the rawmatX parameters from params and store their values in a new table
local argsMaterials = p._extractRawMaterials(args)
mw.logObject(argsMaterials)▼
--empty tables to hold materials
local rawMaterials = {}
Line 23 ⟶ 22:
--get the value for the output product
local output1Value = args.output1 and mw.smw.ask('[[:+]][[' .. args.output1 .. ']]|?Value|limit=1')
local output1TotalValue = 0
if output1Value ~= nil then
output1TotalValue = output1Value[1]['Value'] * (tonumber(args.output1qty) or 1)
Line 40:
rawMaterials = argsMaterials
end
--Simple query to get the shop buy price for the provided material, if no buy price is available returns 0
|