Module:DropsLineRoatz: Difference between revisions

From Roat Pkz
Jump to navigation Jump to search
No edit summary
No edit summary
Line 12: Line 12:
-- precalculated cached data
-- precalculated cached data
local geprices_data = mw.loadJsonData('Module:GEPrices/data.json')
local geprices_data = mw.loadJsonData('Module:GEPrices/data.json')
local geprice = exchange._price
local f_gealch = exchange._highalch
local ptitle = mw.title.getCurrentTitle()
local ns = ptitle.nsText
local title = ptitle.fullText
local pgTitle = ptitle.text
local _noted = '&nbsp;<span class="dropsline-noted">(noted)</span>'
local coins_priceString = "%s Pkp"
local other_priceString = "%s Pkp"
--bg, txt, sort; acceptable non-quantity rarity names
local rarities = {
    always = { 'table-bg-blue', 1 },
    common = { 'table-bg-green', 16 },
    uncommon = { 'table-bg-yellow', 64 },
    rare = { 'table-bg-orange', 128 },
    ['very rare'] = { 'table-bg-red', 1024 },
    random = { 'table-bg-pink', 4096 },
    varies = { 'table-bg-pink', 4096 },
    once = { 'table-bg-pink', 65536 },
    conditional = { 'table-bg-pink', 65536 },
    _default = { 'table-bg-grey', 65536 }
}
-- colour-code
local rarities_class = {
    { 1, 'table-bg-blue' },
    { 1/25, 'table-bg-green' },
    { 1/99.99, 'table-bg-yellow' },
    { 1/999.99, 'table-bg-orange' },
    { 1/9999999, 'table-bg-red' }
}

Revision as of 16:04, 2 April 2024

Documentation for this module may be created at Module:DropsLineRoatz/doc

local p = {}

local params = require('Module:Paramtest')
local lang = mw.language.getContentLanguage()
local coins_image = require('Module:Coins image')
local curr_image = require('Module:Currency Image')
local exchange = require('Module:Exchange') 
local yesno = require('Module:Yesno')

local var = mw.ext.VariablesLua

-- precalculated cached data
local geprices_data = mw.loadJsonData('Module:GEPrices/data.json')

local geprice = exchange._price
local f_gealch = exchange._highalch
local ptitle = mw.title.getCurrentTitle()
local ns = ptitle.nsText
local title = ptitle.fullText
local pgTitle = ptitle.text

local _noted = '&nbsp;<span class="dropsline-noted">(noted)</span>'

local coins_priceString = "%s Pkp"
local other_priceString = "%s Pkp"

--bg, txt, sort; acceptable non-quantity rarity names
local rarities = {
    always = { 'table-bg-blue', 1 },
    common = { 'table-bg-green', 16 },
    uncommon = { 'table-bg-yellow', 64 },
    rare = { 'table-bg-orange', 128 },
    ['very rare'] = { 'table-bg-red', 1024 },
    random = { 'table-bg-pink', 4096 },
    varies = { 'table-bg-pink', 4096 },
    once = { 'table-bg-pink', 65536 },
    conditional = { 'table-bg-pink', 65536 },
    _default = { 'table-bg-grey', 65536 }
}

-- colour-code
local rarities_class = {
    { 1, 'table-bg-blue' },
    { 1/25, 'table-bg-green' },
    { 1/99.99, 'table-bg-yellow' },
    { 1/999.99, 'table-bg-orange' },
    { 1/9999999, 'table-bg-red' }
}