Project

General

Profile

Set » History » Revision 20

Revision 19 (Per Amundsen, 12/14/2019 09:37 AM) → Revision 20/23 (Per Amundsen, 02/06/2020 01:17 AM)

_Added in 1.8.8_ 

 */set [-eklnsuNzgpB] <%var> [value]* 

 Sets the value of %var to the specified value. 

 _See also [[/var]], [[/unset]], [[/dec]], [[/inc]]._ 

 *Switches* 

 -e - Unset the variable when AdiIRC exits. 
 -k - Keeps the unset time (-u) from a previous command. 
 -l - Creates a local variable instead of global. 
 -n - Treat the value as plain text, even if arithmetic operators are used. 
 -s - Display variable assignment value. 
 -uN - Unsets the variable after N amount of seconds, if N = 0 unset the variable after the script is finished. 
 -z - Decreases the value of the variable by 1/ever second until zero is reached. At zero the variable will be unset. 
 -i - Initializes a variable only if it does not already exist as a local or global variable. 
 -g - Sets a global variable even if a local variable exists. 
 -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. 
 -B - Performs a [[$calcint]] calculation instead of regular [[$calc]] when arithmetic operators are used. *(AdiIRC only)* 

 *Parameters* 

 <%var> - The variable to set. 
 [value] - Value to set the variable to. (can be a single [[Arithmetic Operators|arithmetic expression]]) 

 *Example* 

 <pre> 
 alias example { 
   ; Create ;Create a variable and set a value. 
   /set %var Countdown: 

   ; Print ;Print the value 
   /echo -a %var 

   ; Set ;Set the value to 3, decrease once per second 
   /set -zs %var 3 
 } 
 </pre>