Module:NPCMaster/sandbox

local xtable = require('Module:Table') local util = require('Module:Util') local getArgs = require('Module:Arguments').getArgs local m_item = require('Module:Item')

local p = {} local g_frame, g_args

function p.infobox(frame) box = mw.html.create('table') return tostring(box) end

-- =p.experience_progression{lv1_rep=1, lv1_rep_total=1, lv2_rep=1, lv2_rep_total=1, lv3_rep=1, lv3_rep_total=1, lv4_rep=1, lv4_rep_total=1, lv5_rep=1, lv5_rep_total=1, lv6_rep=1, lv6_rep_total=1, lv7_rep=1, lv7_rep_total=1, lv8_rep=1, lv8_rep_total=1} function p.experience_progression(frame) -- data local smw_prefix = 'Has master level ' local lang = mw.getContentLanguage -- get args/frame g_args = getArgs(frame, {       parentFirst = true    }) if frame == nil or type(frame) == 'table' then frame = mw.getCurrentFrame end g_frame = frame -- Argument validation local lv   local lv_n for i=1, 8 do       lv = 'lv' .. i       for _, arg in ipairs({lv .. '_rep', lv .. '_rep_total'}) do            lv_n = tonumber(g_args[arg]) if lv_n == nil then error(arg .. ' must be a valid number') else g_args[arg] = lv_n end end g_args[lv .. '_unlocks'] = g_args[lv .. '_unlocks'] or '?' end -- display & properties exptable = mw.html.create('table') exptable :attr('class', 'wikitable sortable MasterLevelTable') :tag('tr') :tag('th') :wikitext('Level') :done :tag('th') :wikitext(util.html.abbr('Rep.', 'Reputation needed to level up')) :done :tag('th') :wikitext(util.html.abbr('Rep. total', 'Total reputation needed to level up')) :done :tag('th') :wikitext(util.html.abbr('Unlocks', 'Features first unlocked on this level')) :done :done :done for i=1, 8 do       local property = {} local hr       local row = exptable:tag('tr') row :tag('th') :wikitext(i) :done property['is level'] = i       lv = 'lv' .. i

hr = lang:formatNum(g_args[lv .. '_rep']) row :tag('td') :attr('data-sort-value', g_args[lv .. '_rep']) :wikitext(hr) :done property['has experience'] = hr       hr = lang:formatNum(g_args[lv .. '_rep_total']) row :tag('td') :attr('data-sort-value', g_args[lv .. '_rep_total']) :wikitext(hr) :done property['has total experience'] = hr       row :tag('td') :wikitext(g_args[lv .. '_unlocks']) :done property['has unlocks'] = g_args[lv .. '_unlocks'] g_frame:callParserFunction('#subobject:master level', property) end return tostring(exptable) end

function p.crafting(frame) end

return p