Module:Infobox Recipe: Difference between revisions

30 bytes removed ,  Yesterday at 19:25
no edit summary
No edit summary
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
mw.logObject(argsMaterialsoutput1Value)
if output1Value ~= nil then
output1TotalValue = output1Value[1]['Value'] * (tonumber(args.output1qty) or 1)
Line 40:
rawMaterials = argsMaterials
end
mw.logObject(rawMaterials)
 
--Simple query to get the shop buy price for the provided material, if no buy price is available returns 0
839

edits