Module:AlchemistPassiveList: Difference between revisions

simplify getting the value from passive activities that are not recipes, it was broken
(separate out the code to differentiate between passive recipes and passive activities)
(simplify getting the value from passive activities that are not recipes, it was broken)
Line 21:
'?Activity duration = duration',
'?Value = sell',
'?Activity coins = coins',
'sort = Profession Level A',
'limit = 500'
Line 69 ⟶ 70:
item.intermediates = {}
item.buy = 0
item.sell = item.coins
 
-- "sell price" is replaced with the coins that the activity gives
local shopPriceQuery = '[[Name::' .. item.name .. ']]|?Activity coins#-'
local shopPriceResult = mw.smw.ask(shopPriceQuery) or {}
local shopPrice = 0
if shopPriceResult[1] and shopPriceResult[1]["Activity coins"] then
item.sell = tonumber(shopPriceResult[1]["Activity coins"]) or 0
end
else
10,210

edits