Module:Attack speed bar

local p = {}

local editbutton = require('Module:Edit button')

local valid_speeds = { ['1'] = true, ['2'] = true, ['3'] = true, ['4'] = true, ['5'] = true, ['6'] = true, ['7'] = true, ['8'] = true, ['9'] = true, ['10'] = true, ['12'] = true, ['15'] = true, ['random'] = true, ['varies'] = true, }

function p.make_bar(speed) if not speed or speed == '' then return editbutton("? (edit)") end

speed = string.lower(speed)

if not valid_speeds[speed] then return ''.. 'ERR ' end if tonumber(speed) ~= nil then return '' else return '' end end

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

local speed = args[1] or '' return p.make_bar(speed) end

return p