Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ Python ➜ AddTriggerEx - Setting the name for the target variable

AddTriggerEx - Setting the name for the target variable

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


Posted by Worlo   Netherlands  (7 posts)  Bio
Date Sat 29 Jan 2005 09:55 PM (UTC)
Message
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?
Top

Posted by Flannel   USA  (1,230 posts)  Bio
Date Reply #1 on Sun 30 Jan 2005 05:47 AM (UTC)
Message
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?

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
Top

Posted by Worlo   Netherlands  (7 posts)  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

Message
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.
Top

Posted by Ked   Russia  (524 posts)  Bio
Date Reply #3 on Tue 01 Feb 2005 11:33 AM (UTC)
Message
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.
Top

Posted by Worlo   Netherlands  (7 posts)  Bio
Date Reply #4 on Tue 01 Feb 2005 11:41 AM (UTC)
Message
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.
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.


17,373 views.

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

Go to topic:           Search the forum


[Go to top] top

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