Module:Bribes: Difference between revisions

From IdleOn MMO Wiki
mNo edit summary
mNo edit summary
Line 1: Line 1:
local data = mw.loadJsonData('Module:Bribes/data.json')
local data = mw.loadJsonData('Module:Bribes/data.json')
local coinformat = require("Module:CoinDisplay")
local p = {}
local p = {}
local Loops = require("Module:Loops")


local ROW_TEMPLATE = [=[<tr>
local ROW_TEMPLATE = [=[<tr>
Line 28: Line 28:
             name,
             name,
             desc,
             desc,
             frame:callParserFunction( '#invoke', { 'CoinDisplay', 'Main', coins = bribe.cost} )
             coinformat._main({bribe.cost})-- frame:callParserFunction( '#invoke', { 'CoinDisplay', 'Main', coins = bribe.cost} )
         )
         )
     end
     end
Line 35: Line 35:


return p
return p
---------------------------------losin my sanity

Revision as of 01:13, 11 March 2024

hewwo


local data = mw.loadJsonData('Module:Bribes/data.json')
local coinformat = require("Module:CoinDisplay")
local p = {}

local ROW_TEMPLATE = [=[<tr>
<td>%s</td>
<td>%s</td>
<td>%s</td>
</tr>]=]

local ROW_TEMPLATE_EXPANSION = [=[<tr>
<th>%s</th>
<th>%s</th>
<th>%s</th>
</tr>]=]

function p.bribez(frame)
    local ret = ""

    for _, bribe in ipairs(data) do
        local name = bribe.name
        local desc = bribe.desc
        local cost = bribe.cost
        local intName = bribe.intName

        ret = ret .. string.format(
            bribe.intName == "BribeExpansion" and ROW_TEMPLATE_EXPANSION or ROW_TEMPLATE,
            name,
            desc,
            coinformat._main({bribe.cost})-- frame:callParserFunction( '#invoke', { 'CoinDisplay', 'Main', coins = bribe.cost} )
        )
    end
    return ret
end

return p