From WikiChip
Editing mirc/commands/timer
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
This page supports semantic in-text annotations (e.g. "[[Is specified as::World Heritage Site]]") to build structured and queryable content provided by Semantic MediaWiki. For a comprehensive description on how to use annotations or the #ask parser function, please have a look at the getting started, in-text annotation, or inline queries help pages.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
{{mirc title|/timer Command}} | {{mirc title|/timer Command}} | ||
− | The '''/timer command''' can be used to create a general purpose timer. A timer is a way to execute code at some specific interval or time and delay. Timers can be named and unnamed. Unnamed timers will get the lowest numeric timer index available. Named timers are specifically useful if you need to recall that timer at a later period - to pause it, resume it, or simply reset it. Starting a timer with a name that already exists will override the old timer. Timers | + | The '''/timer command''' can be used to create a general purpose timer. A [[timer]] is a way to execute code at some specific interval or time and delay. [[Timers]] can be named and unnamed. Unnamed timers will get the lowest numeric timer index available. Named timers are specifically useful if you need to recall that timer at a later period - to pause it, resume it, or simply reset it. Starting a timer with a name that already exists will override the old timer. Timers only get execute on the main mIRC message loop. I.E. after the alias/event are complete. |
− | only get | ||
== Synopsis == | == Synopsis == | ||
/timers [off] | /timers [off] | ||
/timer[n|name] [off] | /timer[n|name] [off] | ||
− | /timer[n|name] [- | + | /timer[n|name] [-cdeomhiprzN] [time] <repetitions> <interval> <nowiki><code></nowiki> |
== Switches == | == Switches == | ||
Line 21: | Line 20: | ||
Manipulator | Manipulator | ||
* '''-e''' - Executes the code associated with a timer (note: it decrease the number of repetition of the timer, probably resets the time counter as well) | * '''-e''' - Executes the code associated with a timer (note: it decrease the number of repetition of the timer, probably resets the time counter as well) | ||
− | * '''-p''' - Pauses a timer | + | * '''-p''' - Pauses a timer |
− | + | * '''-r''' - Resumes a timer | |
− | * '''-r''' - Resumes a timer | ||
* '''-z'''N - Resets an online timer; N=2 resets total time, N=1, resets current time, and N=0 is the same as N=1 AND N=2 | * '''-z'''N - Resets an online timer; N=2 resets total time, N=1, resets current time, and N=0 is the same as N=1 AND N=2 | ||
Line 37: | Line 35: | ||
{{mIRC|$ctimer}} can be used to return the name of the timer which triggered the current script while {{mIRC|$ltimer}} returns the name of the last timer which triggered. | {{mIRC|$ctimer}} can be used to return the name of the timer which triggered the current script while {{mIRC|$ltimer}} returns the name of the last timer which triggered. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== Example == | == Example == | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
Below is a simple count down timer that uses a call-back alias once per second: | Below is a simple count down timer that uses a call-back alias once per second: | ||
Line 109: | Line 74: | ||
timer 0 1 echo -s $!time(hh:nn:ss) | timer 0 1 echo -s $!time(hh:nn:ss) | ||
}</syntaxhighlight> | }</syntaxhighlight> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== Compatibility == | == Compatibility == |