Project

General

Profile

Timer » History » Version 3

Per Amundsen, 02/26/2017 12:10 AM

1 1 Per Amundsen
_Added in 1.9.0_
2
3
*/timers [off]*
4
*/timer[n|name] [off]*
5
*/timer[n|name] [-cdehimopr] [time] <repetitions> <interval> <code>*
6
7 2 Per Amundsen
Creates a timer that runs <code> at an interval.
8
9
If you are connected to server when the timer is started, it defaults to being a online timer, otherwise it will be a offline timer.
10
11 3 Per Amundsen
A offline timer will continue to run even if the server is disconnected, while a online timer will stop the timer when disconnected.
12 2 Per Amundsen
13 1 Per Amundsen
*Switches*
14
15
-c - TODO
16
-d - TODO
17
-e - Executes the code associated with a timer.
18
-h - Creates a high-resolution timer.
19
-i - Dynamically associates itself with the active connection.
20
-m - Treats the interval parameter as milliseconds instead of seconds.
21
-o - Creates a offline timer.
22
-p - Pauses a timer.
23
-r - Resumes a timer.
24
25
*Parameters*
26
27
[off] - Turns of a timer.
28
[n|name] - The name or index of the timer.
29
[time] - TODO
30
<repetitions> - The amount of timer the timers should repeat itself. An repetition value of '0' will repeat for ever.
31
<interval> - The delay between two consecutive timer executions
32
<code> - Code to be executed. 
33
34
*Example*
35
36
<pre>
37
alias example {
38
  ;Create a variable and set value to 5.
39
  /var %reps = 5
40
 
41
  ;Call the timer %reps times after 1 second delay each.
42
  /.timer %reps 1 count-down
43
 
44
  ;Print the first count.
45
  count-down
46
}
47
alias -l count-down {
48
  echo -a Count: $timer($ltimer).reps
49
}
50
</pre>