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}}{{mIRC menu}} |
− | 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 20: | Line 19: | ||
Manipulator | Manipulator | ||
− | * '''-e''' - Executes the code associated with a timer | + | * '''-e''' - Executes the code associated with a timer |
− | * '''-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 30: | Line 28: | ||
* '''[n|name]''' - The name or index of the timer | * '''[n|name]''' - The name or index of the timer | ||
* '''[time]''' - Time to activate the timer, for example '15:30' for 3:30PM | * '''[time]''' - Time to activate the timer, for example '15:30' for 3:30PM | ||
− | * '''<repetitions>''' - The amount of times the timer should repeat itself. A repetition value of '0' will repeat | + | * '''<repetitions>''' - The amount of times the timer should repeat itself. A repetition value of '0' will repeat for ever. |
* '''<interval>''' - The delay between two consecutive timer executions | * '''<interval>''' - The delay between two consecutive timer executions | ||
* '''<nowiki><code></nowiki>''' - Code to be executed. | * '''<nowiki><code></nowiki>''' - Code to be executed. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== 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 104: | Line 65: | ||
}</syntaxhighlight> | }</syntaxhighlight> | ||
− | A repetition of '0' can also be used to mean an repeat | + | A repetition of '0' can also be used to mean an repeat for ever: |
<syntaxhighlight lang="mIRC">alias cur_time { | <syntaxhighlight lang="mIRC">alias cur_time { | ||
timer 0 1 echo -s $!time(hh:nn:ss) | timer 0 1 echo -s $!time(hh:nn:ss) | ||
}</syntaxhighlight> | }</syntaxhighlight> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== Compatibility == | == Compatibility == | ||
Line 137: | Line 79: | ||
* {{mIRC|$timer}} | * {{mIRC|$timer}} | ||
* {{mIRC|$ctimer}} | * {{mIRC|$ctimer}} | ||
− | |||
* {{mIRC|$time}} | * {{mIRC|$time}} | ||
* {{mIRC|$date}} | * {{mIRC|$date}} |