--function to color skill list based on percentage, there may be a better way to do this, but I couldn't make a repeat-on-same-line trigger work properly
function Linker(name, line, wildcards)
-- first skill variables
skillName = wildcards[1]
spacing = wildcards[2]
percentage = wildcards[3]
-- second skill variables, if applicable
skillName2 = wildcards[4]
spacing2 = wildcards[5]
percentage2 =wildcards[6]
--third skill variables, if applicable
skillName3 =wildcards[7]
spacing3 =wildcards[8]
percentage3 =wildcards[9]
if (tonumber(percentage) == 0) then --color first skill based on percentage, 0 = red, 1-89 = orange, 90-100 = lime
pluginid = GetPluginID()
Hyperlink ("!!" .. pluginid .. ":Enque(skillName)", skillName, "Click to Add", "red", "black", 0)
-- ColourTell("red","", skillName..spacing..percentage.."%") -- Old code
elseif (tonumber(percentage) > 0) and (tonumber(percentage) < 90) then
ColourTell("orange","", skillName..spacing..percentage.."%")
else
ColourTell("lime","", skillName..spacing..percentage.."%")
end --if
I'm editing someone else's code here, but essentially the purpose is to try to get the 'practice' list from a MUD to show up as coloured hyperlinks, so that you can click on the hyperlink to add the skill to a queue to do something with it. |