$1- » History » Version 3
Per Amundsen, 12/11/2018 07:30 PM
1 | 1 | Per Amundsen | _Added in 1.9.0_ |
---|---|---|---|
2 | |||
3 | *$1-$N* |
||
4 | |||
5 | Returns a range of tokens associated with current script. |
||
6 | |||
7 | You can use $N- to refer to parameters N and onward, and $N-M to refer to token $N through to $M. |
||
8 | To refer to a whole line, you would use $1-. |
||
9 | |||
10 | _See also [[/tokenize]]._ |
||
11 | |||
12 | 2 | Per Amundsen | _Can be prefixed with # to ensure the resulted text starts with a channel prefix._ |
13 | |||
14 | 1 | Per Amundsen | *Example* |
15 | |||
16 | <pre> |
||
17 | on *:TEXT:*:*:Number of tokens in the incoming message is $0 first token is $1 all tokens is $1- |
||
18 | |||
19 | alias Example { |
||
20 | ; Tokenize the string 'a,b,c,d. |
||
21 | /tokenize 44 a,b,c,d |
||
22 | |||
23 | ; Print number of tokens. |
||
24 | echo -ag Number of tokens is $0 first token is $1 all tokens is $1- |
||
25 | } |
||
26 | 3 | Per Amundsen | |
27 | ; $1 can be combined with regular text without using $+. |
||
28 | ; NB If your text contains a number, AdiIRC skips every character in your text up to the last number and uses the remaining text. |
||
29 | alias Example { |
||
30 | ; Tokenize the string 'a,b,c,d. |
||
31 | /tokenize 32 abcd |
||
32 | |||
33 | ; Prints 'abcde'. |
||
34 | echo -ag Combined text is $1-e |
||
35 | } |
||
36 | 1 | Per Amundsen | </pre> |