Module:AlchemistPassiveList: Difference between revisions
m
change "potion" to "product" and "reagent" to "material" so it matches all the other crafting profession tables. functionality unchanged.
(remove dependency on Module:Infobox Recipe, as it does not need the recursive recipe finding subroutine) |
m (change "potion" to "product" and "reagent" to "material" so it matches all the other crafting profession tables. functionality unchanged.) |
||
Line 57:
function p.formatResults(results)
-- iterate through
for _, item in ipairs(results) do
Line 66:
-- some fields are easy to work out
item.outputQuantity = 1
item.
item.intermediates = {}
item.buy = 0
Line 79:
-- do not need to extensively search for subrecipes, as passive recipe
-- passive recipes only ever have one step
item.
-- iterate through
item.buy = 0
for _,
--shamelessley lifted from Module:Products
local shopPriceQuery = '[[:+]][[Sold item::' ..
local shopPriceResult = mw.smw.ask(shopPriceQuery) or {}
local shopPrice = 0
Line 96:
end
item.buy = item.buy and item.buy + shopPrice *
end
Line 107:
item.profitPerXP = item.profit and item.XP and math.floor(item.profit / item.XP * 100) / 100
--
local batchSize = 200
local downtime = 0
item.duration = item.duration and item.duration + downtime/batchSize
item.
-- properties per hour
item.XPPerHour = item.XP and item.
item.profitPerHour = item.profit and item.
end
Line 131:
:tag('th')
:attr{ colspan = '3' }
:wikitext('
:done()
:tag('th')
:wikitext('
:done()
:tag('th')
Line 197:
:IF(not(item.passiveActivity))
local
for i, _ in ipairs(item.
end
|