Module:Sandbox/User:The Gaffer/Modules/Infobox Single Step Recipe: Difference between revisions
Module:Sandbox/User:The Gaffer/Modules/Infobox Single Step Recipe (edit)
Revision as of 22:54, 15 November 2024
, Friday at 22:54no edit summary
The Gaffer (talk | contribs) No edit summary |
The Gaffer (talk | contribs) No edit summary |
||
(10 intermediate revisions by the same user not shown) | |||
Line 5:
local mw = require('mw')
local currency = require('Module:Currency').parse
local parse = require('Module:Param Parse')
-- get the buy price from the query result
Line 26 ⟶ 27:
-- Calculate output cost total and profit
local output1cost = args.output1 and mw.smw.ask('[[:+]][[' .. args.output1 .. ']]|?Value|limit=1')
local output1costTotal = output1cost[1]['Value'] * (tonumber(args.output1qty) or 1)
local profit = output1costTotal - totalCost
if args.rawmat1 then
mw.smw.set({
["Uses item"] = args.rawmat1,
})
end
if args.rawmat2 then
mw.smw.set({
["Uses item"] = args.rawmat2,
})
end
if args.rawmat3 then
mw.smw.set({
["Uses item"] = args.rawmat3,
})
end
-- Recipe Table Head
|