![]() |
![]() |
timerStarts a timer |
||||
Usage | ||||
|
||||
Description | ||||
Starts a new timer named <name> with the specified delay (in milliseconds). The timer periodically calls the specified <callback_command> code passing the eventual <callback_param> strings as positional parameters. If a timer with the same name already exists, it is replaced by this one. The <callback_command> is evaluated at timer "shot" time and NOT while this command is being parsed. This means that the identifiers that you put inside <callback_command> will NOT have the current values. The values will be assigned at timer "shot" time. This is a common scripters error and problem: if it is not clear, look at the examples below. The timer is bound to the window in that this command is executed in. If the window gets destroyed, the timer is stopped; unless the -p switch is used. The -p switch causes the timer to be persistent across the application and exists until the last window has been closed: it is basically rebound to another (random) window when the original window is destroyed. The -s switch cuases this timer to trigger only once: it will be automatically destroyed after that. The time has an associated set of extended scope variables: the variables that begin with "%:" have their life extended to the whole "life" of the timer. Using a very low delay is a common method to perform some background processing: you basically split a huge job in small slices and execute them when the timer is triggered until you run out of slices. A delay of 0 will cause the timer to be called whenever KVIrc has some "idle time" to spend. On the other hand, remember that timers are precious resources: many timers running with a very low delay will cause KVIrc to slow down. Since all the kvirc timers share the same namespace it is a good idea to use descriptive timer names: a timer named "a" is likely to be used by two or more scripts at once causing one (or both) of them to fail. A timer can be stopped at any time by using the killtimer command. |
||||
Switches | ||||
|
||||
Syntax Specification | ||||
|
||||
Examples | ||||
|
||||
See also | ||||
killtimer |