timer
¶
A timer data type is set in tenths of one second and counts down to zero; starting immediately after being set.
Members¶
int OriginalValue
¶
- Original value of the timer
int Value
¶
- Current value of the timer
string To String
¶
- Same as Value
Methods¶
Name | Action |
---|---|
Expire | Set the timer to 0 |
Reset | Reset the timer to the original value |
Set[value] | Set the timer to the given value |
Usage¶
Consider the following timer:
/declare BuffTimer timer local
/varset BuffTimer 360
BuffTimer will be equal to 0 in:
- 360 tenths of 1 second
- 36 seconds
- 6 ticks (a tick is 6 seconds)
Timers may also be set with an "s" (seconds) or an "m" (minutes) appended to the value. For example:
/varset BuffTimer 360s
This would set the timer to 3600 (360 * 10) tenths of 1 second
/varset BuffTimer 360m
This would set the timer to 216000 (360 * 60 * 10) tenths of 1 second
sub main
/declare myTimer timer local 100
/while ( ${myTimer} ) {
/echo ${myTimer}
/delay 10
}
/return
This would loop while myTimer is above 0