Can I assign a trigger to a group using a script?

Posted by Amun on Fri 18 Dec 2020 06:10 PM — 2 posts, 13,653 views.

#0
I'm having trouble finding any information about doing that. I'm seeing how to enable a group or disable a group, but nothing about assigning a trigger I am creating using a script to a group upon creation, or afterwards.

I'm using LUA if that's relevant.


.... Nevermind! I found it.

https://www.gammon.com.au/scripts/doc.php?function=SetTriggerOption
Amended on Fri 18 Dec 2020 06:15 PM by Amun
USA Global Moderator #1
If you're writing a plugin file, you can set group="whatever_you_want" in the xml portion of the trigger in the same way as you set the other trigger options like name, priority, etc. If you're not writing a plugin, it's one of the GUI interface options.

https://mushclient.com/copying shows an example of both.

You only need to use SetTriggerOption if you're dynamically creating triggers or groups on the fly.