DoAfterNote
Script function

world.DoAfterNote

DOC_scripting Read about scripting

Type

Method

Summary

Adds a one-shot, temporary note timer - simplified interface

Prototype

long DoAfterNote(long Seconds, BSTR NoteText);

DOC_data_types View list of data type meanings


Description

This routine adds an unlabelled, temporary, one-shot note timer, set to go off after the designated number of seconds. The first argument (seconds) must evaluate to a time between 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.

When the time elapses the text will be "noted" - that is, displayed in the output window, not sent to the MUD.

You can also use DoAfter if you wish to send to the world.

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 DoAfterNote is implemented by using temporary MUSHclient timers, it will not work if timers are disabled. If DoAfterNote is not working for you (however the function call is returning zero) then ensure that timers are enabled in the Timers configuration dialog.



VBscript example

world.DoAfterNote 60, "Spell has worn off!"



Jscript example

world.DoAfterNote (60, "Spell has worn off!");



PerlScript example

$world->DoAfterNote (60, "Spell has worn off!");



Python example

world.DoAfterNote (60, "Spell has worn off!")



Lua example

DoAfterNote (60, "Spell has worn off!")



Return value

eTimeInvalid: The time is invalid (seconds not in range 0.1 to 86,399). 
eOK: added OK


DOC_errors View list of return code meanings


See Also ...

Topic

DOC_note Notes

Functions

FNC_AddTimer AddTimer (Adds a timer)
FNC_AnsiNote AnsiNote (Make a note in the output window from text with ANSI colour codes imbedded)
FNC_DoAfter DoAfter (Adds a one-shot, temporary timer - simplified interface)
FNC_DoAfterSpecial DoAfterSpecial (Adds a one-shot, temporary, timer to carry out some special action)
FNC_DoAfterSpeedWalk DoAfterSpeedWalk (Adds a one-shot, temporary speedwalk timer - simplified interface)
FNC_GetNoteStyle GetNoteStyle (Gets the style for notes)
FNC_Hyperlink Hyperlink (Creates a hyperlink in the output window)
FNC_Note Note (Sends a note to the output window)
FNC_NoteHr NoteHr (Draws a horizontal rule in the output window)
FNC_NoteStyle NoteStyle (Sets the style for notes)
FNC_SetNotes SetNotes (Sets the notes for the world.)
FNC_Tell Tell (Sends a message to the output window - not terminated by a newline)

(Help topic: function=DoAfterNote)

DOC_contents Documentation contents page