Could someone tell me what is wrong with this function?
If I call the function with the wildcard "mana" (from an alias) and don't have tprint, the "for k,v in ipairs (healpriority)" loop doesn't do a thing, but it enters the if statement (that's why I put "Note" there, to check).
If I use tprint, no matter what wildcard I use, either health, mana or ego, it prints the same table
I've been trying to see what is wrong with it for a couple of hours now, any suggestions?
function change_priority(name,line,wildcards)
if (wildcards [1] == "health") then
healpriority = {}
healpriority = {health = "drink health", mana = "drink mana", ego = "drink bromide"}
end
if (wildcards [1] == "mana") then
healpriority = {}
Note ("mana")
healpriority = {mana = "drink mana", health = "drink health", ego = "drink bromide"}
for k, v in ipairs (healpriority) do
Tell (tostring(k),"=")
Note (v)
end -- for
end
if (wildcards [1] == "ego") then
healpriority = {}
healpriority = {ego = "drink bromide", health = "drink health", mana = "drink mana"}
end
ColourTell ("aqua","","Healing priority: ") ColourNote ("lime","", string.upper(wildcards [1]))
tprint (healpriority)
end
If I call the function with the wildcard "mana" (from an alias) and don't have tprint, the "for k,v in ipairs (healpriority)" loop doesn't do a thing, but it enters the if statement (that's why I put "Note" there, to check).
If I use tprint, no matter what wildcard I use, either health, mana or ego, it prints the same table
ego=drink bromide
mana=drink mana
health=drink health
I've been trying to see what is wrong with it for a couple of hours now, any suggestions?