How to use AddTrigger to add a trigger with 'Repeat on same line' set?

Posted by j0nas on Sat 09 Sep 2006 08:50 PM — 4 posts, 19,203 views.

#0
I'm trying to use AddTrigger to add a trigger with, among other things, the 'Repeat on same line' flag set. The 'trigger_flag'-flags listed in the help-files don't mention any such flag.

Is that flag available? If not, is the constant I need available to be thrown in there 'manually' instead?
Australia Forum Administrator #1
See this thread:

http://www.gammon.com.au/forum/?id=7123

And this one:

http://www.gammon.com.au/forum/?id=7336

If you are using MUSHclient 3.80, it is simple, as the necessary code mentioned in the first post is now in a separate module. Thus you could do something like this:


require "addxml"
addxml.trigger {  match = "swordfish", 
                regexp = true,
                ['repeat'] = true,   -- repeat is lua keyword
                send = "hi there",
                sequence = 50,
                enabled = true,
                name = "boris",
              }


Amended on Sat 09 Sep 2006 10:39 PM by Nick Gammon
Australia Forum Administrator #2
You could also add the trigger first, and then modify it with the "repeat" option using SetTriggerOption:

http://www.gammon.com.au/scripts/doc.php?function=SetTriggerOption

#3
The addxml.trigger was a very neat solution that solved another problem of mine I had already forgotten about. Thanks!