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


Script function


Read about scripting




Gets the list of timers


VARIANT GetTimerList();

View list of data type meanings


Returns an array of all the named timers currently defined. You can then use GetTimer or GetTimerInfo for more details about each one.

Note - from version 3.40 onwards GetTimerList returns all timers, even unlabelled ones. The unlabelled timers will have assigned an "internal" label (like "*timer42") that can be used in GetTimerInfo, and similar routines.

VBscript example

dim timerList

timerList = world.GetTimerList

If Not IsEmpty (timerList) then

   For Each t In timerList
     world.Note t 

End If

Jscript example

timerlist = new VBArray(world.GetTimerList()).toArray();

if (timerlist)  // if not empty
 for (i = 0; i < timerlist.length; i++)
   world.note(timerlist [i]);

PerlScript example

foreach $item (Win32::OLE::in ($world->GetTimerList))

Python example

timerlist = world.GetTimerList
if (timerlist):
  for t in timerlist : world.Note (t)

Lua example

tl = GetTimerList ()
if tl then
  for k, v in ipairs (tl) do 
    Note (v) 
  end  -- for
end -- if we have any timers

Lua notes

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

Return value

If there are no timers (with names) then the return value is empty. Use "IsEmpty" to test for this possibility.

Otherwise, it returns a variant array containing the names of all the timers. Use "ubound" to find the number of timers in the list.

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
(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
(GetTimerInfo) Gets details about a timer
(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=GetTimerList)

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]