Module:Elven workerIconTest

local p = {}

local _data = { Amlodd = { icon =, level = 94, xp = 140, vos = 168 }, Cadarn = { icon =, level = 93, xp = 135, vos = 162 }, Crwys = { icon =, level = 97, xp = 155, vos = 186 }, Hefin = { icon =, level = 96, xp = 150, vos = 180 }, Iorwerth = { icon =, level = 91, xp = 125, vos = 150 }, Ithell = { icon =, level = 92, xp = 130, vos = 156 }, Meilyr = { icon =, level = 98, xp = 170, vos = 204 }, Trahaearn = { icon =, level = 95, xp = 145, vos = 174 }, }

function p.main(frame) local args = frame:getParent.args

local vos = { args['vos1'], args['vos2'] } local level = tonumber(args.level) local boost = tostring(args.boost) == 'Yes' if level < 98 and boost then level = level + 4 boost = true else boost = false end

if level < 91 then return 'You do not have a high enough Thieving level to pickpocket any worker.' end

local xptable = {}

for w, v in pairs(_data) do		if level >= v.level then local _add = {} _add.n = w			_add.level = v.level if vos[1] == w or vos[2] == w then _add.xp = v.vos _add.vos = true else _add.xp = v.xp			end table.insert(xptable,_add) end end

table.sort(xptable, function(a,b) return a.xp > b.xp end)

local ret = mw.html.create('table') :addClass('wikitable') :tag('tr') :tag('th') :wikitext('Icon') :tag('th') :wikitext('Clan') :done :tag('th') :wikitext('Level') :done :tag('th') :wikitext('XP') :done :done for _, v in ipairs(xptable) do		local row = ret:tag('tr')

if v.vos then row:css('background','#afafaf') end

row	:tag('td') :wikitext(v.icon) :done :tag('td') :wikitext(v.n)			:done :tag('td') :wikitext(v.level) :done :tag('td') :wikitext(v.xp) :done :done end

ret:done ret:wikitext('Highlights indicate the clan has the Voice of Seren in effect.') if boost then ret:wikitext(' To thieve from every clan listed, you will need the Abyssal lurker\'s scroll for its +4 thieving boost.') end

return ret end

return p