Set » History » Version 15
Per Amundsen, 12/29/2018 09:24 AM
1 | 1 | Per Amundsen | _Added in 1.8.8_ |
---|---|---|---|
2 | |||
3 | 14 | Per Amundsen | */set [-eklnsuNzgp] <%var> [value]* |
4 | 1 | Per Amundsen | |
5 | Sets the value of %var to the specified value. |
||
6 | |||
7 | 15 | Per Amundsen | _See also [[/var]], [[/unset]]._ |
8 | |||
9 | 1 | Per Amundsen | *Switches* |
10 | |||
11 | 8 | Mr. BS | -e - Unset the variable when AdiIRC exits. |
12 | 1 | Per Amundsen | -k - Keeps the unset time (-u) from a previous command. |
13 | -l - Creates a local variable instead of global. |
||
14 | -n - Treat the value as plain text, even if arithmetic operators are used. |
||
15 | -s - Display variable assignment value. |
||
16 | 9 | Per Amundsen | -uN - Unsets the variable after N amount of seconds, if N = 0 unset the variable after the script is finished. |
17 | 10 | Per Amundsen | -z - Decreases the value of the variable by 1/ever second until zero is reached. At zero the variable will be unset. |
18 | 1 | Per Amundsen | -i - Initializes a variable only if it does not already exist as a local or global variable. |
19 | -g - Sets a global variable even if a local variable exists. |
||
20 | 14 | Per Amundsen | -p - Permits value to be 2 literal double quotes and permits value to end with a single [[$chr]](32) space. Also enables -n switch behavior. |
21 | 1 | Per Amundsen | |
22 | *Parameters* |
||
23 | |||
24 | <%var> - The variable to set. |
||
25 | 7 | Per Amundsen | [value] - Value to set the variable to. (can be a single [[Arithmetic Operators|arithmetic expression]]) |
26 | 1 | Per Amundsen | |
27 | *Example* |
||
28 | |||
29 | 6 | Per Amundsen | <pre> |
30 | 1 | Per Amundsen | alias example { |
31 | ;Create a variable and set a value. |
||
32 | /set %var Countdown: |
||
33 | |||
34 | ;Print the value |
||
35 | /echo -a %var |
||
36 | |||
37 | ;Set the value to 3, decrease once per second |
||
38 | /set -zs %var 3 |
||
39 | } |
||
40 | 6 | Per Amundsen | </pre> |