[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Python
. . -> [Subject]  AddTriggerEx - Setting the name for the target variable
Home  |  Users  |  Search  |  FAQ
Register forum user name
Forgotten password?

AddTriggerEx - Setting the name for the target variable

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Posted by Worlo   Netherlands  (7 posts)  [Biography] bio
Date Sat 29 Jan 2005 09:55 PM (UTC)
Hey I am playing around with creating some on demand triggers using AddTriggerEx and want to generate one that is named maxHealthTrigger which sends the contents of a wildcard to a variable called maxHP. This is what I got so far

TriggerFlags = eEnabled + eKeepEvaluating + eTriggerRegularExpression + eReplace + eTemporary
world.AddTriggerEx ("maxHealthTrigger","Health: \d{2-5}/(\d{2-5})","%1", TriggerFlags, NOCHANGE, 0, "", "", 9, 100)

However when I look at the trigger created it is called maxHealthTrigger and that is the target Variable as well. Is there some option I am missing or do I have to use that name as a variable?
[Go to top] top

Posted by Flannel   USA  (1,230 posts)  [Biography] bio
Date Reply #1 on Sun 30 Jan 2005 05:47 AM (UTC)
You would have to go through afterwards and change the option of the variable (SetTriggerOption). You could also send to script, and then use that to send to the variable in the send text.

Why are you adding a well defined trigger through a script anyway?


Messiah of Rose
Eternity's Trials.

Clones are people two.
[Go to top] top

Posted by Worlo   Netherlands  (7 posts)  [Biography] bio
Date Reply #2 on Sun 30 Jan 2005 09:01 AM (UTC)

Amended on Sun 30 Jan 2005 09:03 AM (UTC) by Worlo

Well I don't want this trigger to be around unless I look at the SCORE command which lists my maximum health among other things, so I have an alias sc that creates some triggers and then runs through the score command and removes the triggers again when I receive the last line of the score sheet. I figured that I would just make a group though and disable the group only enabling it when needed, but it is also nice practice.

Could probably make a trigger wizard if I wanted which I might end up doing.
[Go to top] top

Posted by Ked   Russia  (524 posts)  [Biography] bio
Date Reply #3 on Tue 01 Feb 2005 11:33 AM (UTC)
It would probably be much easier to just have some triggers preset (in a plugin) and simply enable them all as a group when typing "sc|score|scor|etc", then disable them on a prompt. It's also likely to be much faster. How much faster depends on the number of triggers you are using - the more triggers, the bigger the difference, since 5 triggers mean 5 calls to AddTriggerEx, while with EnableTriggerGroup it takes only one call for any number of triggers.
[Go to top] top

Posted by Worlo   Netherlands  (7 posts)  [Biography] bio
Date Reply #4 on Tue 01 Feb 2005 11:41 AM (UTC)
Yeah well that is what I did in the end, but like I said I am still learning about all functions I can use and how they work.
I did get something to work to make triggers with standard options easily. I can now use an alias standtrig with the trigger line as argument and it makes a trigger with standard option to which I then later only add the send info.
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum

[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]