Editing Module:Sandbox/User:Alsang/PotionList
Jump to navigation
Jump to search
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 2: | Line 2: | ||
local param = require( 'Module:Paramtest' ) |
local param = require( 'Module:Paramtest' ) |
||
local currency = require('Module:Currency') |
local currency = require('Module:Currency') |
||
local lang = mw.getContentLanguage() |
|||
require("Module:Mw.html extension") |
|||
Line 107: | Line 105: | ||
item.hasDuration = param.has_content(item.brewDuration) and param.has_content(item.prepDuration) |
item.hasDuration = param.has_content(item.brewDuration) and param.has_content(item.prepDuration) |
||
-- XP/KP strings, if the requisite data isnt there then display "unknown" |
|||
if item.hasXP then |
|||
--item.xp = lang:formatNum(item.xp) -- format to include commas |
|||
item.XP = item.XP -- format to include commas |
|||
else |
|||
item.XP = 'Unknown' |
|||
end |
|||
if item.hasKP then |
|||
item.KP = item.KP .. '%' -- want 1 decimal place |
|||
else |
|||
item.KP = 'Unknown' |
|||
end |
|||
if item.hasXP and item.hasDuration then |
|||
item.XPPerHour = item.XPPerHour -- format to include commas |
|||
else |
|||
item.XPPerHour = 'Unknown' |
|||
end |
|||
if item.hasKP and item.hasDuration then |
|||
item.KPPerHour = item.KPPerHour -- want 2 decimal places |
|||
else |
|||
item.KPPerHour = 'Unknown' |
|||
end |
|||
end |
end |
||
Line 153: | Line 178: | ||
:wikitext('Coins/XP') |
:wikitext('Coins/XP') |
||
:done() |
:done() |
||
--:tag('th') |
|||
-- :wikitext('KP') |
|||
--:done() |
|||
--:tag('th') |
|||
-- :wikitext('KP/hr') |
|||
--:done() |
|||
:done() |
:done() |
||
Line 198: | Line 229: | ||
:IF(item.hasSell) |
:IF(item.hasSell) |
||
-- I cannot for the life of me figure out why, |
|||
-- but if I put item.sell directly into this function it claims it has value nil |
|||
-- it works for other functions to display it directly |
|||
-- so here is the workaround I guess |
|||
--:wikitext(currency_cell(item.buy+200*item.profit)) |
|||
:wikitext(currency_cell(item.sell)) |
:wikitext(currency_cell(item.sell)) |
||
:ELSE() |
:ELSE() |
||
Line 232: | Line 268: | ||
:tag('td') |
:tag('td') |
||
:IF(item.hasXP) |
:IF(item.hasXP) |
||
:wikitext |
:wikitext(item.XP) |
||
:ELSE() |
:ELSE() |
||
:addClass('table-bg-grey') |
:addClass('table-bg-grey') |
||
Line 242: | Line 278: | ||
:tag('td') |
:tag('td') |
||
:IF(item.hasXP and item.hasDuration) |
:IF(item.hasXP and item.hasDuration) |
||
:wikitext |
:wikitext(item.XPPerHour) |
||
:ELSE() |
:ELSE() |
||
:addClass('table-bg-grey') |
:addClass('table-bg-grey') |