GetTimerList
Script function

world.GetTimerList

DOC_scripting Read about scripting

Type

Method

Summary

Gets the list of timers

Prototype

VARIANT GetTimerList();

DOC_data_types View list of data type meanings


Description

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 
   next

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))
 {
 $world->note($item);
 }



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 ...

Topics

DOC_aliases Aliases
DOC_defaults Default triggers/aliases/timers/macros/colours
DOC_starting Getting started
DOC_group Groups
DOC_plugins Plugins
DOC_timers Timers
DOC_triggers Triggers

Functions

FNC_AddTimer AddTimer (Adds a timer)
FNC_DeleteTemporaryTimers DeleteTemporaryTimers (Deletes all temporary timers)
FNC_DeleteTimer DeleteTimer (Deletes a timer)
FNC_DeleteTimerGroup DeleteTimerGroup (Deletes a group of timers)
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_EnableTimer EnableTimer (Enables or disables an timer)
FNC_EnableTimerGroup EnableTimerGroup (Enables/disables a group of timers)
FNC_GetTimer GetTimer (Gets details about a timer)
FNC_GetTimerInfo GetTimerInfo (Gets details about a timer)
FNC_GetTimerOption GetTimerOption (Gets the value of a named timer option)
FNC_IsTimer IsTimer (Tests to see if a timer exists)
FNC_ResetTimer ResetTimer (Resets a named timer)
FNC_ResetTimers ResetTimers (Resets all timers)
FNC_SetTimerOption SetTimerOption (Sets the value of a named timer option)

(Help topic: function=GetTimerList)

DOC_contents Documentation contents page