Module:AlchemistList: Difference between revisions
m
Remove unused vars
Tag: Undo |
m (Remove unused vars) |
||
Line 1:
require('strict')
require('Module:Mw.html extension')
local param = require( 'Module:Paramtest' )
local currency = require('Module:Currency')
local lang = mw.getContentLanguage()
local p = {}
Line 10 ⟶ 9:
-- non dynamic module, no inputs
function p.main()
-- returns almost every parameter needed for the row, except buy values for reagents
local query = {
Line 53 ⟶ 51:
-- iterate through potions
for
--in case of single reagent potions, make table of 1 element
Line 63 ⟶ 61:
-- starting value 20 is for bottle
item.buy = 20
for
--shamelessley lifted from Module:Products
Line 76 ⟶ 74:
item.buy = item.buy + shopPrice
end
-- direct values
Line 111 ⟶ 98:
-- make the table
function p.displayTable(results)
local out = mw.html.create('table')
:addClass('wikitable sortable')
Line 151 ⟶ 137:
:done()
:done()
for i,item in ipairs(results) do▼
reagentCell = reagentCell .. '[[File:' .. reagent .. '.png|30px|link=' .. reagent .. ']] [[' .. reagent .. ']]<br>'▼
end▼
local unknown_value_cell = mw.html.create('td')
Line 166 ⟶ 143:
:wikitext("''unknown''")
▲ for i, item in ipairs(results) do
local row = out:tag('tr')
:IF(item.lvl)
:tag('td')
Line 181 ⟶ 158:
:done()
▲ reagentCell
▲ end
row
:wikitext(currency_cell(item.buy))
:wikitext(currency_cell(item.sell))
:wikitext(currency_cell(item.profit))
:wikitext(currency_cell(item.profitPerHour))
Line 212 ⟶ 189:
:done()
end
|