Description of MUSHclient world function: world.DoAfter
||Adds a one-shot, temporary timer - simplified interface
long DoAfter(double Seconds, BSTR SendText);
View list of data type meanings
This routine adds an unlabelled, temporary, one-shot timer, set to go off after the designated number of seconds. The first argument (seconds) must evaluate to a time between 0.1 second, and 23 hours 59 minutes 59 seconds (that is, 0.1 to 86,399).
From version 3.61 onwards of MUSHclient the interval may include fractions (ie. it is a floating-point number). This lets you set up sub-second intervals (eg. 0.5 seconds, 1.2 seconds).
To enable this you need to go to Global Configuration -> Timers and set the 'Timer Interval' in seconds to zero.
The maximum granularity of the timers is currently 0.1 seconds. In other words, regardless of what you specify, the timers are only checked every 10th of a second.
You can also use DoAfterSpeedWalk - this is the same as DoAfter, except the command is interpreted as a speedwalk sequence.
You can also use DoAfterNote - this is the same as DoAfter, except the text is sent to the output window, not the MUD.
The purpose of this is simplify the frequent case of simply wanting to do something in a few seconds, rather than using AddTimer.
WARNING - as DoAfter is implemented by using temporary MUSHclient timers, it will not work if timers are disabled. If DoAfter is not working for you (however the function call is returning zero) then ensure that timers are enabled in the Timers configuration dialog.
Note: Available in version 3.18 onwards.
world.DoAfter 10, "eat food"
world.DoAfter 20.5, "get bottle bag"
world.DoAfter 21, "drink water"
world.DoAfter (10, "eat food");
world.DoAfter (20.5, "get bottle bag");
world.DoAfter (21, "drink water");
$world->DoAfter (10, "eat food");
$world->DoAfter (20.5, "get bottle bag");
$world->DoAfter (21, "drink water");
world.DoAfter (10, "eat food")
world.DoAfter (20.5, "get bottle bag")
world.DoAfter (21, "drink water")
DoAfter (10, "eat food")
DoAfter (20.5, "get bottle bag")
DoAfter (21, "drink water")
eTimeInvalid: The time is invalid (seconds not in range 0.1 to 86,399).
eOK: added OK
View list of return code meanings
|Introduced in version
See also ...
||Adds a timer
||Adds a one-shot, temporary note timer - simplified interface
||Adds a one-shot, temporary, timer to carry out some special action
||Adds a one-shot, temporary speedwalk timer - simplified interface
Search for script function
Enter a word or phrase in the box below to narrow the list down to those that match.
The function name, prototype, summary, and description are searched.
Leave blank to show all functions.
Many functions return a "code" which indicates the success or otherwise
of the function.
view a list of the return codes
The "prototype" part of each function description lists exactly how the function is called (what arguments, if any, to pass to it).
view a list of the data types used in function prototypes
View all functions
Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.
Gammon Software support
Forum RSS feed ( https://gammon.com.au/rss/forum.xml )