Editing Module:Sandbox/User:Alsang/PotionList

Jump to navigation Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

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(lang:formatNum(tonumber(item.XP)))
: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(lang:formatNum(tonumber(item.XPPerHour)))
:wikitext(item.XPPerHour)
:ELSE()
:ELSE()
:addClass('table-bg-grey')
:addClass('table-bg-grey')
Please note that all contributions to Brighter Shores Wiki are considered to be released under the CC BY-NC-SA 3.0 (see Brighter Shores:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!
Cancel Editing help (opens in new window)
Preview page with this template