Command : Timer


Syntax


TIMER (start|stop|kill|list|shot) [name] [timeout] [command]

Description


This command manages internal timers.
START:
Syntax: TIMER start < timer-name > < timeout-in-msec > < command >
The start option will start an internal timer.
If a timer with the same name is already running it will be replaced.
The timeout must be specified in milliseconds , and the lower limit for that parameter is 100 msec.
Please note that many timers (or 2-3 timers with a short timeout may slow down kvirc,especially if the command executed outputs text using the echo command.
The command parameter specifies the command to be executed when the timer 'fires'.
TIMER start test_timer 10000 /echo $_window Timeout!!!
In the above example example the command will be created a timer with name test_timer and 10 seconds timeout.
NOTE : The identifiers in the command are parsed when the timer is created.
The timer is 'connected' to the window where it is started.
If you start a timer in the #channel window (or start it in a command that is running 'in that window',each call to $_window or $_chan will return #channel.
If the window can not be found when the timer 'fires',the timer is automatically removed.
SHOT:
Syntax: TIMER shot < timeout > < command >
This will create a timer that fires only once with the specified timeout.
Useful for example to perform temporaneous bans from popups :
Popup command:
kban $_selected 10 seconds ban!; timer shot 10000 /unban $_selected
STOP:
Syntax: TIMER stop < timer-name >
The stop option will remove an internal timer.
If the timer is not running,it will do nothing.
LIST:
Syntax: TIMER list
This will print a list of currently active timers.
KILL:
Syntax: TIMER kill
This will stop ALL the active timers.

Index  Command list  Commandline syntax