Module:Equipment tables

local pt = require('Module:Paramtest') local hc = pt.has_content local dt = pt.default_to

local p = {}

p.armourrow = function(frame) local a = frame:getParent.args local ret = '' if hc(a.version1) then -- switchfo rows else ret = make_armour_row({			name = a['%TITLE%'],			class = a.class,			tier = a.tier,			armour = a.armour,			life = a.life,			prayer = a.prayer,			magic = a.magic,			ranged = a.ranged,			strength = a.strength,		}) end return ret end

function make_armour_row(bon) local ret = '\n|-\n| ' .. bon.name if bon.version then ret = ret .. ' ' .. bon.version .. ' '	end ret = ret .. string.format('\n| %s\n| %s\n| %s\n| %s\n| %s\n| %s\n| %s',								dt(bon.class, '?'),								get_num(bon.tier),								get_num(bon.armour),								get_num(bon.life),								get_num(bon.prayer),								get_num(bon.strength),								get_num(bon.ranged),								get_num(bon.magic)) return ret end

function get_num(v) return tonumber(dt(v, '?')) or '?' end

return p