Project

General

Profile

Set » History » Version 19

Per Amundsen, 12/14/2019 09:37 AM

1 1 Per Amundsen
_Added in 1.8.8_
2
3 16 Per Amundsen
*/set [-eklnsuNzgpB] <%var> [value]*
4 1 Per Amundsen
5
Sets the value of %var to the specified value.
6
7 18 Per Amundsen
_See also [[/var]], [[/unset]], [[/dec]], [[/inc]]._
8 15 Per Amundsen
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
-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 19 Per Amundsen
-B - Performs a [[$calcint]] calculation instead of regular [[$calc]] when arithmetic operators are used. *(AdiIRC only)*
22 1 Per Amundsen
23
*Parameters*
24
25
<%var> - The variable to set.
26 7 Per Amundsen
[value] - Value to set the variable to. (can be a single [[Arithmetic Operators|arithmetic expression]])
27 1 Per Amundsen
28
*Example*
29
30 6 Per Amundsen
<pre>
31 1 Per Amundsen
alias example {
32
  ;Create a variable and set a value.
33
  /set %var Countdown:
34
35
  ;Print the value
36
  /echo -a %var
37
38
  ;Set the value to 3, decrease once per second
39
  /set -zs %var 3
40
}
41 6 Per Amundsen
</pre>