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


Script function


Read about scripting




Gets details about a timer


VARIANT GetTimerInfo(BSTR TimerName, short InfoType);

View list of data type meanings


Gets details about the specified timer name.

You can obtain one of 26 "types" of information about the timer by specifying an "InfoType". The possible InfoTypes are:

1: The hour (short)
2: The minute (short)
3: The second (short)
4: What to send (string)
5: Script procedure name (string)
6: Enabled (boolean)
7: One shot timer (boolean)
8: "At" timer (if false, timer fires "every" hour/minute/second) (boolean)
9: Invocation count (long)
10: Times matched (long)
11: Date/time timer last fired (or was reset) (date)
12: Date/time timer will fire next (date)
13: Number of seconds until timer will fire next or zero if it is due to fire immediately (this might happen if the timer is due to fire but is disabled). (double)
14: 'temporary' flag (boolean)
15: 'speed walk' flag (boolean)
16: 'note' flag (boolean)
17: 'active when disconnected' flag (boolean)
18: Timer was included from an include file (boolean)
19: Group name (string)
20: Send-to location (long)
21: User option value (long)
22: Timer label (string)
23: 'Omit from output' flag (boolean)
24: 'Omit from log file' flag (boolean)
25: 'Executing-script' flag (boolean)
26: Script is valid flag (boolean)

The word in brackets indicates the "type" of data returned.
String: a character string (eg. "north")
Boolean: TRUE or FALSE
Long: a 32-bit number

The field "invocation count" is a count of how many times the script routine was called.
The field "times matched" is a count of how many times the timer matched. These two would normally be the same, unless scripting was disabled, or there was an error in the script file.

The meanings of the "send-to" field are:

0: World
1: Command window
2: Output window
3: Status line
4: Notepad (new)
5: Notepad (append)
6: Log File
7: Notepad (replace)
8: Command queue
9: Send To Variable
10: Execute (re-parse as command)
11: Speedwalk (send text is speedwalk, queue it)
12: Script (send to script engine)
13: Immediate (send to world in front of speedwalk queue)
14: Script - after omit

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

See AddTimer for a description of the meanings of the fields.

VBscript example

world.note world.GetTimerInfo ("my_timer", 2)

Jscript example

world.note(world.GetTimerInfo ("my_timer", 2));

PerlScript example

$world->note ($world->GetTimerInfo ("my_timer", 2));

Python example

world.note(world.GetTimerInfo ("my_timer", 2))

Lua example

Note(GetTimerInfo ("my_timer", 2))

Lua notes

Lua returns nil where applicable instead of an "empty variant" or "null variant".

The "SendTo" field can be looked up using the "sendto" table in the Lua global address space, as follows:

sendto.world = 0
sendto.command = 1
sendto.output = 2
sendto.status = 3
sendto.notepad = 4
sendto.notepadappend = 5
sendto.logfile = 6
sendto.notepadreplace = 7
sendto.commandqueue = 8
sendto.variable = 9
sendto.execute = 10
sendto.speedwalk = 11
sendto.script = 12
sendto.immediate = 13
sendto.scriptafteromit = 14

Return value

The specified information about the timer, as described above.
An EMPTY variant, if the timer does not exist.
A NULL variant if the timer name is invalid.
A NULL variant if the InfoType is not a valid type.

See Also ...


Default triggers/aliases/timers/macros/colours
Getting started


(AddTimer) Adds a timer
(DeleteTemporaryTimers) Deletes all temporary timers
(DeleteTimer) Deletes a timer
(DeleteTimerGroup) Deletes a group of timers
(DoAfter) Adds a one-shot, temporary timer - simplified interface
(DoAfterSpecial) Adds a one-shot, temporary, timer to carry out some special action
(DoAfterSpeedWalk) Adds a one-shot, temporary speedwalk timer - simplified interface
(EnableTimer) Enables or disables an timer
(EnableTimerGroup) Enables/disables a group of timers
(GetInfo) Gets information about the current world
(GetPluginTimerOption) Gets the value of a named timer option for a specified plugin
(GetPluginTriggerOption) Gets the value of a named trigger option for a specified plugin
(GetTimer) Gets details about a timer
(GetTimerList) Gets the list of timers
(GetTimerOption) Gets the value of a named timer option
(IsTimer) Tests to see if a timer exists
(ResetTimer) Resets a named timer
(ResetTimers) Resets all timers
(SetTimerOption) Sets the value of a named timer option

(Help topic: function=GetTimerInfo)

Documentation contents page

Search ...

Enter a search string to find matching documentation.

Search for:   

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]