$loop » History » Version 2
Per Amundsen, 10/28/2020 10:58 PM
1 | 1 | Per Amundsen | _Added in 1.9.7_ |
---|---|---|---|
2 | |||
3 | *$loop(N, M, text)* |
||
4 | |||
5 | Starts a loop from 'N' to 'M' and executes 'text' with $1 and \1 as the current number and returns a space separated text from the result of 'text'. |
||
6 | |||
7 | 2 | Per Amundsen | _\1 is replaced with $+ $1 $+._ |
8 | |||
9 | 1 | Per Amundsen | *Parameters* |
10 | |||
11 | N - Starting number. |
||
12 | M - End number. (N + M = end) |
||
13 | text - The identifier(s) to execute. |
||
14 | |||
15 | *Example* |
||
16 | |||
17 | <pre> |
||
18 | ; Return a list of all nicks in the channel |
||
19 | //echo -ag $loop(1, $nick(#, 0), $nick(#, \1)) |
||
20 | |||
21 | ; Whois all nicks in a channel |
||
22 | alias iwhois { |
||
23 | whois $1 |
||
24 | } |
||
25 | //noop $loop(1, $nick(#, 0), $iwhois($nick(#, \1))) |
||
26 | </pre> |