Timer

From Scriptwiki
Revision as of 12:43, 26 November 2005 by Doomie (talk | contribs) (need to reboot.)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Activates the specified timer to perform the specified command at a specified interval, and optionally at a specified time.

/timer[N/name] [-ceomhipr] [time] <repetitions> <interval> <command>

If you are not connected to a server and a timer is started, it will be an offline timer by default, meaning that it will continue to run whether you are connected to a server on not. If you aren't connected to a server while starting a timer, it will be an online timer, that will stop if you disconnect. You can make a timer being an offline timer by using the -o switch.

To make a new timer, you can either use /timer without name/number or you can specify a name or not, without space between the command and the name (/timerfoo ...). If you do not specify a name/number, mIRC will get the first free timernumber it finds and use this.

If you specify a delay of 0 seconds, the timer will trigger immediately after the calling script ends.

You can also specify a time when the timer is supposed to trigger (see example below).

Note that if you specify 0 repetitions it will continue until you either stop it yourself or you disconnect, in case it is an online timer.

Note that identifiers usually do not get re-evaluated during a timer (see example below). To force this, you have to use an exclamation mark after the $ of an identifier (e.g. $!time or $!me)


You can use the following switches:

switchexplanation
cwill make mIRC "catch up" a timer by executing it more than once during one interval if the real-time interval isn't matching your requested interval.
-m / -hindicates that the interval delay is in milliseconds.
-hmake a high-resolution multimedia timer (uses system resources heavily)
-ewill executes the command associated with the specified timer name (works with wildcard names too).
-pwill pause a timer
-rwill resume a timer
-iwill make a timer dynamically associate with whatever happens to be the active connection. If a server window is closed, the timer is associated with the next available server window.