DeleteTriggerGroup have a bug!!!

Posted by Randomcho on Sun 20 Nov 2011 11:46 AM — 3 posts, 14,474 views.

China #0
Is this a bug?

example:

require "addxml" --自动用lua创建trigger的module
addxml.trigger {
match = "^.*已经陷入半昏迷状态,随时都可能摔倒晕去",
regexp = true,
send = "DeleteTriggerGroup('temp_tr')",
sequence = 100,
enabled = true,
send_to="12",
group="temp_tr",
keep_evaluating = "y",
}

but can not delete the trigger group!

---------------------------------------------------

function test()
DeleteTriggerGroup("temp_tr")
end

addxml.trigger {
match = "^.*已经陷入半昏迷状态,随时都可能摔倒晕去",
regexp = true,
send = "test()",
sequence = 100,
enabled = true,
send_to="12",
group="temp_tr",
keep_evaluating = "y",
}

also can not delete the trigger group!
------------------------------------------------------
but use Timer,can delete the trigger group

Amended on Sun 20 Nov 2011 11:58 AM by Randomcho
USA Global Moderator #1
This is documented behavior.

Quote:
WARNING - if the trigger is executing a script it cannot be deleted. For example, a trigger cannot delete itself.

If you need to delete a trigger from within itself use DoAfterSpecial to delete it after a short delay. You might also want to use EnableTriggerGroup to disable it first.

http://mushclient.com/scripts/doc.php?function=DeleteTriggerGroup
China #2
thanks!Fiendish