Module:Icons

local p = {} local iconTip = { [Slow] = "Slow", [Stun] = "Stun", [Sleep] = "Sleep", [Silence] = "Silence", [Rooted] = "Rooted", [Grounded] = "Grounded", [Fear] = "Fear", [Disarm] = "Disarm", [Blind] = "Blind", [Airborne] = "Airborne", } local gameIcon = { [Slow] = "Slow.png", [Stun] = "Stun.png", [Sleep] = "Sleep.png", [Silence] = "Silence.png", [Rooted] = "Rooted.png", [Grounded] = "Grounded.png", [Fear] = "Fear.png", [Disarm] = "Disarm.png", [Blind] = "Blind.png", [Airborne] = "Airborne.png", } local iconSize = { ["small"]          = "x10px", ["medium"]         = "x14px", ["normal"]         = "x14px", ["big"]            = "x20px", } local gameIcon = { } function p.Icons(frame) local iconList = mw.text.split(frame.args[1], ",") local parserError = "" local iconSetting if frame.args[2] ~= nil and string.len(frame.args[2]) > 0 then iconSetting = tostring(frame.args[2]) if iconSize[iconSetting] ~= nil then iconSetting = iconSize[iconSetting] end else iconSetting = iconSize["medium"] end local iconLinks if frame.args[3] ~= nil then iconLinks = mw.text.split(frame.args[3], ",") end local tipOverride if frame.args[4] ~= nil then tipOverride = mw.text.split(frame.args[4], ",") end local n = 1 local result = "" while n <= table.getn(iconList) do       newIcon = iconList[n] if gameIcon[newIcon] ~= nil then currentIcon = gameIcon[newIcon] if tipOverride ~= nil and tipOverride[n] ~= nil and string.len(tipOverride[n]) > 0 then currentTip = tipOverride[n] else if iconLinks ~= nil and iconLinks[n] ~= nil and string.len(iconLinks[n]) > 0 then currentTip = iconLinks[n] else splitTip = mw.text.split(iconTip[newIcon], "|") currentTip = splitTip[1] end end else currentIcon = "Icon question.png" currentTip = "Unrecognized icon name" result = result .. ""       end result = result .. ' '       result = result .. ' '       if n < table.getn(iconList) then result = result .. " "       end n = n + 1 end return result .. parserError end function p.platforms(frame) local icons = mw.text.split(frame.args[1], ",") local iconCount = 1 local platformCheck = "" local result = "" while iconCount <= table.getn(icons) do       currentIcon = iconTip[string.lower(icons[iconCount])] platformCheck = mw.text.split(currentIcon, "|") if platformCheck[2] ~= nil then result = result .. ' ' .. "Has platform::"           result = result .. platformCheck[1] .. ' ' result = result .. '' result = result .. ""           result = result .. ' '           if iconCount < table.getn(icons) then result = result .. " "           end end iconCount = iconCount + 1 end if result == "" then result = '[Platforms needed]' end return result end function p.Test(frame) local iconList = mw.text.split(frame.args[1], ",") local parserError = "" local iconSetting if frame.args[2] ~= nil and string.len(frame.args[2]) > 0 then iconSetting = tostring(frame.args[2]) if iconSize[iconSetting] ~= nil then iconSetting = iconSize[iconSetting] end else iconSetting = iconSize["medium"] end local iconLinks if frame.args[3] ~= nil then iconLinks = mw.text.split(frame.args[3], ",") end local tipOverride if frame.args[4] ~= nil then tipOverride = mw.text.split(frame.args[4], ",") end local n = 1 local result = "" while n <= table.getn(iconList) do       newIcon = string.lower(iconList[n]) if gameIcon[newIcon] ~= nil then currentIcon = gameIcon[newIcon] if tipOverride ~= nil and tipOverride[n] ~= nil and string.len(tipOverride[n]) > 0 then currentTip = tipOverride[n] else if iconLinks ~= nil and iconLinks[n] ~= nil and string.len(iconLinks[n]) > 0 then currentTip = iconLinks[n] else splitTip = mw.text.split(iconTip[newIcon], "|") currentTip = splitTip[1] end end else currentIcon = "Icon question.png" currentTip = "Unrecognized icon name" result = result .. ""       end result = result .. 'Current tip: ' .. currentTip .. " : " .. string.len(currentTip) .. '\n' result = result .. ']] '       if n < table.getn(iconList) then result = result .. " "       end n = n + 1 end return result .. parserError end return p