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 ➜ Tips and tricks ➜ Dual triggers

Dual triggers

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


Posted by Marvi218   (1 post)  Bio
Date Tue 17 Feb 2004 02:18 AM (UTC)
Message
I'm a new user to MUSHclient and might i say, I'm very impressed and I'm probably going to stick with it! I was wondering, though, if there was any way to set up a trigger reaction to two triggers. Let me provide an example

Trigger: You begin to tense your muscles, preparing to doublejab.

Reaction: jab @tar

The thing is before i can jab my target, I need to regain my equilibrium first ("You regain your equilibrium") I can't put "jab @tar" as a reaction to 'You regain your equilibrium' because there are other ways to lost equilibrium and I tried to do a delay of 1 or 2 seconds but it's either too early or too late, it's inconsistant. So what I'm asking is: Is there a way for my command to be sent when it sees one trig line, then the next trig line?
Top

Posted by Ked   Russia  (524 posts)  Bio
Date Reply #1 on Tue 17 Feb 2004 05:47 AM (UTC)
Message
The most obvious solution would be to have 2 triggers:

trigger1 for when you start to tense your muscles

trigger2 for when you regain equilibrium(sends jab @tar)

You could keep both triggers disabled by default and when
you want to prepare for a jab, send the corresponding command and immediately enable trigger1. When trigger1 matches it should disable itself and enable trigger2. When trigger2 matches it should send jab @tar and disable itself.

To enable a trigger use: world.EnableTrigger "trigger_name", 1

To disable it: world.EnableTrigger "trigger_name", 0
Top

Posted by Nick Gammon   Australia  (23,159 posts)  Bio   Forum Administrator
Date Reply #2 on Tue 17 Feb 2004 06:30 AM (UTC)
Message
Yes, I agree with Ked.

Have two triggers, A and B.

A is always enabled, B is usually disabled.

When A fires it enables B.

(ie. world.EnableTrigger "B", 1)

Then when B fires it does its stuff and disables itself.

eg.

world.Send "jab @tar"
world.EnableTrigger "B", 0

This is done by "send to script" in the trigger(s).

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


10,263 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.