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 ➜ General ➜ Passing constant parameters from triggers

Passing constant parameters from triggers

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


Posted by Renquist   (11 posts)  Bio
Date Sat 19 Aug 2006 10:10 PM (UTC)
Message
Hello,

How do I pass constant params to a script from a trigger?

I have a static trigger that does not contain any variables. When it fires it calls a python script named EnemyStatus. ie:
<trigger match="^static text with no variation here\.$">

When calling EnemyStatus I want to pass static parameters to it. The parameters are not part of the triggered text. ie:
In the script EnemyStatus( sName, sLine, wildcards )
wildcards[0] is "EnemyName"
wildcards[1] is 200
etc.

How do I go about this?

- Renquist
Top

Posted by Nick Gammon   Australia  (23,140 posts)  Bio   Forum Administrator
Date Reply #1 on Sat 19 Aug 2006 10:50 PM (UTC)
Message
That's what MUSHclient variables are for. They are static in the sense that they don't change until you want them to.


So, you might do something like:

enemyname = GetVariable ("enemyname")

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Renquist   (11 posts)  Bio
Date Reply #2 on Sun 20 Aug 2006 09:58 PM (UTC)
Message
Thanks, that worked like a charm. I did not realize a trigger would execute the send field and also an associated script function.
Top

Posted by Nick Gammon   Australia  (23,140 posts)  Bio   Forum Administrator
Date Reply #3 on Mon 21 Aug 2006 09:37 AM (UTC)
Message
The exact process (which is rather complicated) is described here:

http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=6554

- Nick Gammon

www.gammon.com.au, www.mushclient.com
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.


13,383 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.