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 ➜ Can I make triggers fire once?

Can I make triggers fire once?

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


Posted by Passiflora   (1 post)  Bio
Date Fri 24 Dec 2004 06:29 PM (UTC)

Amended on Fri 24 Dec 2004 06:31 PM (UTC) by Passiflora

Message
I'm part of a player killing clan. I'd like my trigger to fire only once, to alert the clan I'm being attacked and by whom.

I've got that down fine, but the problem is my trigger goes of when I shout that I'm being attacked, which can happen more than once in the span of 20 seconds or so.

Is there any way to get the trigger to only fire one time and then stop, but have it fire again should a DIFFERENT person attack later?
Top

Posted by Flannel   USA  (1,230 posts)  Bio
Date Reply #1 on Fri 24 Dec 2004 06:43 PM (UTC)
Message
You can make your trigger turn itself off.

You'll have to figure out when you want it to turn itself back on though, whether you want to have an alias for it, or if there is something you can trigger on once you;re done being attacked.

(Assuming you're using VBscript:)
You need to change the "send to" box to script (its a pulldown menu) and then give your trigger a label (a unique name). Then in your send box, since youre already sending things to the world, youll have to change those lines to include quotes around what you want to send and a "send" at the beginning of the line.
If you wanted to send:
help help, I'm being attacked!
Your send box would now contain:
send "help help, I'm being attacked!"

For the turning itself off, you'll add a second to that send box:
EnableTrigger "[triggerlabel]", 0
where [triggerlabel] is the label you gave to your trigger.

If you don't mind turning your trigger back on after X seconds, you can simply use a DoAfter to turn it back on, this will create a timer that re-enables your trigger (after however long). So if you are still being attacked, it will trigger again, however it will cut down on your spam.
To use that, you will add a third line to your send box:
DoAfter 10, "EnableTrigger "[triggerlabel]", 12
Where 10 is the ammount of seconds (and [triggerlabel] is the same as above).

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
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.


11,311 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.