Module:FisherPassiveList: Difference between revisions
m
condense table by omitting " (skill node)" from the displayed links to the skill nodes (link still goes to node)
(starting copy of miner, needs a lot of data checking) |
m (condense table by omitting " (skill node)" from the displayed links to the skill nodes (link still goes to node)) |
||
(4 intermediate revisions by the same user not shown) | |||
Line 22:
'?Activity coins = coins',
'?Skill node name = product',
'?Activity input #- = material',
'sort = Profession Level A',
'limit = 500'
Line 56 ⟶ 57:
for _, item in ipairs(results) do
--catch badly submitted data
▲ item.product = item.product or ''
-- price of bait
end▼
end
-- price of fish
-- query is: there is a shop object page that has this item AND has buy price cannot be "N/A"
local query = mw.smw.ask('[[Sold item::' .. item.product .. ']][[Shop sell price::!~N/A]]|?Shop sell price=data|mainlabel=-')
if type(query)=='table' then
-- price is returned as a number
item.sell = tonumber(query[1].data)*0.005 or 0
else
-- will return nil if the item is not in a shop, or if it is in a shop but can only be sold to the shop
item.sell = 0
-- profitability
item.profit = item.buy and item.sell and item.sell - item.buy
item.profitPerXP = item.profit and item.XP and item.profit / item.XP
-- no downtime for passives
Line 78 ⟶ 92:
-- properties per hour
item.XPPerHour = item.XP and item.productPerHour and math.floor(item.XP * item.productPerHour)
item.
end
Line 90 ⟶ 104:
:tag('tr')
:tag('th')
:wikitext('[[File:
:done()
:tag('th')
:attr{ colspan = '2' }
:wikitext('
:done()
:tag('th')
:attr{ colspan = '3' }
:wikitext('
:done()
:tag('th')
:attr{ colspan = '10' }
:wikitext('Quantity/hr')▼
:wikitext('Buy<br>Value')
:attr{ colspan = '3' }
:done()
:tag('th')
:attr{ colspan = '10' }
:wikitext('Sell<br>Value')
:done()
:tag('th')
:attr{ colspan = '10' }
:wikitext('Profit')
:done()
:tag('th')
Line 113 ⟶ 140:
:wikitext('XP/hr')
:done()
-- :tag('th')
-- :attr{ colspan = '10' }
-- :wikitext('Coins/XP')
-- :done()
:done()
Line 133 ⟶ 164:
:END()
--
:tag('td')
:css{ ['border-right'] = '0', ['text-align'] = 'right', ['max-width'] = '100px' }
Line 142 ⟶ 173:
:tag('td')
:addClass('plinkt-link no-border')
:wikitext('[[' .. item.name .. '|' .. item.product ..']]')
:done()
--
:tag('td')
:css{ ['border-right'] = '0', ['text-align'] = 'right' }
:attr{ ['data-sort-value'] = item.
:wikitext(' 0.005 × ')
:done()
:tag('td')
:css{ ['border-right'] = '0', ['border-left'] = '0', ['text-align'] = 'center', ['max-width'] = '100px' }
:addClass('plinkt-link no-border')▼
:wikitext('
:done()
:tag('td')
:wikitext('[[' .. item.material .. ']]')
:done()
-- profit per hour (coins)▼
-- fish
:tag('td')
:css{ ['border-right'] = '0', ['text-align'] = 'right' }
:attr{ ['data-sort-value'] = item.product }
:wikitext('0.005 × ')
:done()
:tag('td')
:css{ ['border-right'] = '0', ['border-left'] = '0', ['text-align'] = 'center', ['max-width'] = '100px' }
:addClass('plinkt-link no-border')
:wikitext('[[File:' .. item.product .. '.png|link=' .. item.product .. '|30x30px]]')
:done()
:tag('td')
:css{ ['border-left'] = '0', ['text-align'] = 'left' }
▲ :addClass('plinkt-link no-border')
:wikitext('[[' .. item.product .. ']]')
:done()
-- economics
:node(currency_cell(item.sell))
▲ :tag('td')
:node(currency_cell(item.profit))
▲ :css{ ['text-align'] = 'right' }
:node(currency_cell(item.profitPerHour))
▲ :wikitext('0.9 × [[File:' .. item.product .. '.png|link=' .. item.product .. '|30x30px]]')
▲ :done()
▲ -- profit per hour (coins)
▲ :node(currency_cell(item.coinsPerHour))
-- XP
Line 187 ⟶ 233:
:node(unknown_value_cell)
:END()
-- coins per xp
-- :node(currency_cell(item.profitPerXP))
:done()
|