$world->timer
$world->timer function: creates a TIMER
void $world->timer( |
attributes
) ; |
void $world->timer( |
number
, |
attributes
) ; |
Creates a new timer, or edits the timer identified by number.
atributes
is a reference to a hash
defining attributes for the timer. Generally the call works like
this:
$world->timer({ attribute1 => value1, attribute2 => value2, ... })
Possible attributes:
interval
: Number of seconds
between each execution. Fractions of seconds (such as 1.5) are
allowed. Required.
count
: Number of times to execute
the timer. After this number of executions, the timer will be
automatically disabled or deleted (see temporary
flag below). If count
is not given or
count
is -1, the timer repeats until manually
disabled or deleted.
action
: The action to execute.
Required.
temporary
: If set to 1, the timer
will be deleted (and not only disabled) after
count
executions have happened.
enabled
: If set to 1, the timer
is enabled and will execute every count
seconds.
If set to 0, the timer does not execute until enabled again. New
timers are created enabled by default.
name
: Assigns a name to the
timer, so that it can be referenced by name.