Messenger Plus! Live - Scripting Documentation
The MsgPlus::AddTimer function creates a new timer event for your
script. The OnEvent_Timer event will be fired once after the specified time interval
elapses.
Syntax
AddTimer(
[string] TimerId,
[number] Elapse
);
Parameters
- TimerId
- [string] Unique string identifying the new timer. Every script
can create up to 100 timers, each one with their own unique
identifier. When a timer event occurs, the Id is passed as
parameter. You can specify any string you want for
TimerId apart from an empty string.
Different scripts can use identical TimerId
without worrying of possible conflicts.
- Elapse
- [number] Amount of time that has to elapse, in milliseconds,
before the event is fired. This number needs to be in the range of
100 to 86,400,000 (one day).
Return Value
No value is returned by this function.
This function typically fails for the following reason:
- The maximum number of timers allowed for this script has been
reached.
- The Elapse parameter is not in the valid range of accepted
values.
Remarks
Messenger Plus! timers are generated only once. When the event is
fired, the timer is removed from the list. If you desire the event to be
generated on regular intervals, simply call AddTimer in
OnEvent_Timer. If AddTimer is called with the
TimerId of an existing timer event, the
event is reset with the new Elapse time.
Function Information
Object |
MsgPlus |
Availability |
Messenger Plus! Live 4.00 |
See Also
MsgPlus Object,
CancelTimer,
OnEvent_Timer.