Enable / Disable Trigger

Posted by Tkl1129 on Wed 28 Dec 2011 07:57 AM — 4 posts, 24,970 views.

Hong Kong #0
Hi all,

Just want to ask a stupid quesiton.

in a World, 1st Connect was suppose all trigger is enable?

After reconnect to the world, do the status of the trigger is reset to default "Enable", or remain the same with last setting?

I feel confuse to setup the Label & Group name of the trigger that is hard to manage in reconnect case.

Please share yr exp and commnet for advice, thanks.
USA #1
No. Your triggers' enabled flag is not reset on reload. They will save between sessions.

As for labels and groups, if you open up the specific trigger window, you should see the two boxes labelled "Label" and "Group". These can then be controlled with scripting via

EnableTrigger()

and

EnableTriggerGroup()

respectively.

If you have five triggers that are part of the same group; say, "attacks", you can disable all of your attacks via a script in an alias or some other means by calling

EnableTriggerGroup("attacks",false)

To turn them back on:

EnableTriggerGroup("attacks",true)

This also applies to single triggers via the Label box, or if editing the script directly from a text editor, the "name" variable.

No two triggers/aliases/timers can have the same label/name. MUSHClient really yells at you if you try this. Thus, if you look at the last example..five triggers in the "attacks" group, each one could be labelled: attack1, attack2, attack3, attack4, and attack5.

Say you only want to be able to use four of them instead of all five. You can disable the one trigger you don't want enabled with:

EnableTrigger("attack4",false)

and turn it back on with:

EnableTrigger("attack4",true)



Also note:

These correlate pretty closely with EnableAliasGroup(), EnableAlias(), EnableTimerGroup(), and EnableTimer().
Hong Kong #2
Thanks,

Since I'm Zmud user before that I usually control the trigger with enable / disable the class...

and all the en / dis status will reset by default when the session is reconnect.

now when I'm using mush, even relogin, close mush or reopen, the enable / disable status will be keep at the last status.

So I've to re-design of my trigger group.
Australia Forum Administrator #3
Things are how you left them. When you save a Word document, things are how you left them when you open it next time, right?

You can enable/disable a group of triggers with EnableTriggerGroup (or EnableGroup if you want to do aliases and timers as well).

You can make a "on world open" event in your script file, and that event can enable/disable such groups as you see fit. Or you could use the "on world connect" event.

Template:function=EnableGroup
EnableGroup

The documentation for the EnableGroup script function is available online. It is also in the MUSHclient help file.