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 ➜ Create new timers from script?

Create new timers from script?

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


Posted by Scorch   (1 post)  Bio
Date Sat 27 Dec 2003 10:18 PM (UTC)
Message
I wanted to make temp timers from a script which is activated by a trigger (for protection spells on a MUD, spell goes up, 5 minutes later it goes back down). The problem with using a predefined timer is I want to be able to cast these protection spells on more than one person, perhaps an entire party of 8. It'd be much more efficient to be able to create a temporary timer that calls a function that tells everyone the spell is failing for a particular person.

I can't seem to find anything in the help files on creating new timers via the scripting language though, any help?
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #1 on Sun 28 Dec 2003 02:30 AM (UTC)
Message
First, look at these online help pages:

http://www.gammon.com.au/scripts/doc.php?general=timers

(Follow the hyperlinks to the various timer-creating functions).

However the quick answer is you could use the "DoAfter" function to cast spells after a certain interval. For example:

DoAfter 300, "cast protection Nick"

You could do that in a trigger by putting that in the trigger "send" text and changing it to "send to script".

To do a whole party you could add more lines to the trigger, or if the party varies a lot, keep a party list in a variable, extract that variable using Split, and then use "for each" to iterate through the extracted array. If you want an example of doing that let us know.

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


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