Valid names of triggers. Doesn't matter if you CTRL+SHIFT+8 and pick a trigger and copy n paste it's label, If you're in a
for k,v in iPairs(GetTriggerList()), if you're getting the trigger name from a
function filter(s) in the Filter By dialog box...
How I discovered this is a little funny and a little embarrassing. On the mud I play is the Necromancers guild ("Necros" as everyone in the world would be wont to shorten it), and I was commenting that while I love our mutual friend, I hate partying with him because the guild is spammy as hell with epileptic seizure inducing ansi changes. Friend C said he agrees and that's why he has the entire guild's spam gagged. I said "Ooooh, gimme them triggers!" and so he sent me the file with his TinTin++ #gags... Some quick search 'n' replace in my favorite text editor and I changed all the #gag {matchtext}; into AddTrigger("NecroGag01", "matchtext", "", 7, -1, 0, "", ""), incrementing the name as appropriate.
You might notice that flags are only 7 (enabled, omit, omitlog)... and I forgot the RegEx flag. And I wanted to throw all of them into a group for quick n easy plugin wizard export... And UH OH, that's a really unfortunate typo for a white guy in America to make... yeaaaa... "NecroGag01" doesn't have a "c" in it, it has an erroneous "g". I should REALLY change that. And that's when I found out the following code doesn't work, and while debugging it, none of the "name" changes work even from the command prompt with a Send to Script character preceding it.
function filter (s)
--print (s, type(s), s:find("negrogag"))
if s:find("negrogag") then
SetTriggerOption(s, "group", "NecroGags")
local tempname = s:gsub("egro", "ecro")
SetTriggerOption(s, "name", tempname)
return true
elseif s:find("necrogag") then
return true
else
return false
end
end -- filter
Modifying the group works, adding the RegEx flags worked (in previous iterations of the code); so I am grabbing the correct trigger name and modifying them correctly. The "name" case in SetTriggerOption does not function.
And I did try just a single line SetTriggerOption line from the command window just in case this was a time when modifying a list during traversal has undefined results.