[Home] [Downloads] [Search] [Help/forum]

MUSHclient scripting

Description of MUSHclient world function: world.GetTimerOption

Name GetTimerOption
Type Method
Summary Gets the value of a named timer option
Prototype VARIANT GetTimerOption(BSTR TimerName, BSTR OptionName);

View list of data type meanings


Gets the current value of a timer option.

You must specify the name of an existing timer, and a timer option from the list below. These are the same names as used in the XML world files for timer options.

Note that you can neither get nor set the "name" field. It is listed below for completeness in viewing timers copied to the clipboard or in world files and plugins. You already know the name when getting the timer option (it is TimerName), and this function is provided to modify existing timers, not rename them. To change the name of a timer use ExportXML, modify the XML, and then ImportXML.

The return type is Variant, so the returned value will be the appropriate type for the data (ie. string or number (long)).

If the option name is not known, or is not allowed to be retrieved, a NULL variant is returned.

If the named timer does not exist, EMPTY is returned. If the name given is invalid, NULL is returned. If the option name is not known, EMPTY is returned. (Use "IsEmpty" and "IsNull" to test for these possibilities).

For a detailed description about the meanings of the fields, see AddTimer.

If GetTimerOption is called from within a plugin, the timers for the current plugin are used, not the "global" MUSHclient timers.

To find options for timers in other plugins, use GetPluginTimerOption.

The various option names are:

"active_closed": y/n - timer is active when world closed
"at_time": y/n - y=fire *at* time of day, otherwise every interval
"enabled": y/n - timer is enabled
"group": (string - group name)
"hour": hour to fire at (or every hour)
"minute": minute to fire at (or every minute)
"name": (string - name/label of alias)
"offset_hour": offset hour - fire at time *plus* this
"offset_minute": offset minute - fire at time *plus* this
"offset_second": offset second - fire at time *plus* this
"omit_from_log": y/n - omit timer from log file
"omit_from_output": y/n - omit timer output from log file
"one_shot": y/n - delete after firing
"script": (string - name of function to call)
"second": hour to fire at (or every second)
"send": (multi-line string - what to send)
"send_to": 0 - 13 - "send to" location (see below)
"user": -2147483647 to 2147483647 - user-defined number
"variable": (string - name of variable to send to)

Boolean options (shown as y/n) are returned as 0 for false (n) or 1 for true (y).

Send-to locations

"0" - send to MUD
"1" - put in command window
"2" - display in output window
"3" - put in status line
"4" - new notepad
"5" - append to notepad
"6" - put in log file
"7" - replace notepad
"8" - queue it
"9" - set a variable
"10" - re-parse as command
"11" - send to MUD as speedwalk
"12" - send to script engine
"13" - send without queuing
"14" - send to script engine - after omitting from output

Note: Available in version 3.29 onwards.

VBscript example
Note world.GetTimerOption ("mytimer", "group")
Jscript example
Note (world.GetTimerOption ("mytimer", "group"));
PerlScript example
$world->Note ($world->GetTimerOption ("mytimer", "group"));
Python example
world.Note (world.GetTimerOption ("mytimer", "group"))
Lua example
Note (GetTimerOption ("mytimer", "group"))
Lua notes
Lua returns nil where applicable instead of an "empty variant" or "null variant".
Returns As described above.
Introduced in version 3.29

See also ...

Function Description
AddTimer Adds a timer
GetPluginTimerOption Gets the value of a named timer option for a specified plugin
GetTimerInfo Gets details about a timer
SetTimerOption Sets the value of a named timer option

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.

Search for:   

Leave blank to show all functions.

Return codes

Many functions return a "code" which indicates the success or otherwise of the function.

You can view a list of the return codes

Function prototypes

The "prototype" part of each function description lists exactly how the function is called (what arguments, if any, to pass to it).

You can view a list of the data types used in function prototypes

View all functions


Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]