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
➜ Timed triggers.
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Drazzen
(11 posts) Bio
|
Date
| Tue 26 Nov 2002 08:56 PM (UTC) |
Message
| Is there a way to get triggers to only execute after 'x' amount of seconds have elapsed.
I play a mud where a common attack is to stun the player then follow up with a mental attack. If I cannot set the trigger to execute 2 seconds after the attack it miss-fires due to my char being stunned.
| Top |
|
Posted by
| Meerclar
USA (733 posts) Bio
|
Date
| Reply #1 on Tue 26 Nov 2002 09:12 PM (UTC) |
Message
| I'm fairly certain there is a way to do this but you've failed to consider something in your timing issues. It may not be possible to launch an attack 2 seconds after your stun lands on your opponent due to the delay inherent in the stun attack. |
Meerclar - Lord of Cats
Coder, Builder, and Tormenter of Mortals
Stormbringer: Rebirth
storm-bringer.org:4500
www.storm-bringer.org | Top |
|
Posted by
| Drazzen
(11 posts) Bio
|
Date
| Reply #2 on Tue 26 Nov 2002 09:14 PM (UTC) |
Message
| I meant that I am stunned and I need to wait 2 seconds before the trigger fires so the stun has time to wear off. The stun is a set time. | Top |
|
Posted by
| Drazzen
(11 posts) Bio
|
Date
| Reply #3 on Tue 26 Nov 2002 09:38 PM (UTC) |
Message
| Found the answer...
Per Nick (thanks Nick)...
Set the trigger to send the output to World(speedwalk delay) and the trigger will fire at the after whatever delay you have set in your speedwalk.
| Top |
|
Posted by
| Magnum
Canada (580 posts) Bio
|
Date
| Reply #4 on Tue 26 Nov 2002 09:56 PM (UTC) |
Message
| That's fine if you don't mind your speedwalk delay set to a whopping 2 seconds. Sure makes walking slow though.
A better solution is to call a script subroutine when the trigger fires. You might use a routine like this:
Sub OnStunned
World.DoAfter 2, "blast"
End Sub
That code snippet is in VBS (Visual Basic Script).
Scripting isn't all that scary. As you can see, a mere three lines accomplishes your task. If you want more flexibility, you could set up an alias to choose on-the-fly which form of attack you want to use. Also, if you need a target, you could quickly set that as well with an alias or trigger.
These kind of things are asked for frequently here in the forums. Have a look around to learn more. :) |
Get my plugins here: http://www.magnumsworld.com/muds/
Constantly proving I don't know what I am doing...
Magnum. | Top |
|
Posted by
| Nick Gammon
Australia (23,158 posts) Bio
Forum Administrator |
Date
| Reply #5 on Sun 01 Dec 2002 08:31 PM (UTC) |
Message
| Magnum is right, although trigger scripts need three arguments, like this:
Sub OnStunned (name, line, wildcards)
World.DoAfter 2, "blast"
End Sub
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Drazzen
(11 posts) Bio
|
Date
| Reply #6 on Sun 01 Dec 2002 11:15 PM (UTC) |
Message
| I am still trying to figure scripting out. I am trying to find a place to learn it so that I can begin using it. I am unsure as of yet how it ties into my trigger. | Top |
|
Posted by
| Nick Gammon
Australia (23,158 posts) Bio
Forum Administrator |
Date
| Reply #7 on Thu 05 Dec 2002 02:48 AM (UTC) |
Message
| You could make a small file with those three lines in it. Call it "myscript.vbs" and save it to disk (use Notepad to do that). Then enable scripting, language VBscript, and choose your "myscript.vbs" file as the name of the script file.
Finally, edit your trigger and enter "OnStunned" as the script routine to call if the trigger fires. |
- 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.
22,255 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top