Difference between revisions of "Aliases"

From IceChat Wiki
Jump to: navigation, search
(Created page with "Aliases are self-defined commands, usually shortcuts to common IRC commands. For example, <code>/j</code> instead of <code>/join</code>. IceChat 9 comes with a pre-defined s...")
 
Line 9: Line 9:
 
<code>/alias name, /command name, </code> followed by additional parameters, if required by the command.
 
<code>/alias name, /command name, </code> followed by additional parameters, if required by the command.
  
The parameters are either [[Identifiers]] or general variables in the form of <code>$1, S2</code> etc.
+
The parameters are either [[Identifiers]] or general variables in the form of <code>$1, $2</code> etc.
  
 
Example:<br />
 
Example:<br />
Line 21: Line 21:
  
 
<dt>$1</dt>
 
<dt>$1</dt>
<dd>1st paramer of the <code>kick</code> command: the nick to be kicked.</dd>
+
<dd>1st parameter of the <code>kick</code> command: the nick to be kicked.</dd>
  
 
<dt>$2</dt>
 
<dt>$2</dt>
<dd>2nd (optional) paramer of the <code>kick</code> command: the reason for the kick.</dd>
+
<dd>2nd (optional) parameter of the <code>kick</code> command: the reason for the kick.</dd>
 +
 
 +
<dd>If you wish to have a parameter, and all the remaining parameters, use a - after it. IE: $2- returns the 2nd parameter, and all the rest</dd>
  
 
</dl>
 
</dl>

Revision as of 15:23, 7 March 2015

Aliases are self-defined commands, usually shortcuts to common IRC commands. For example, /j instead of /join.

IceChat 9 comes with a pre-defined set of aliases, and the user can change, remove or add new ones. Aliases are located on the IceChat Editor which can be reached from the Options menu entry, or with Ctrl+S keyboard shortcut.

Ice9-open-editor.jpg


The format for an alias is:
/alias name, /command name, followed by additional parameters, if required by the command.

The parameters are either Identifiers or general variables in the form of $1, $2 etc.

Example:
/k /kick $1 $2

/k
Alias name
/kick
The kick command
$1
1st parameter of the kick command: the nick to be kicked.
$2
2nd (optional) parameter of the kick command: the reason for the kick.
If you wish to have a parameter, and all the remaining parameters, use a - after it. IE: $2- returns the 2nd parameter, and all the rest

It is possible to use one alias inside another.
It is possible to define an alias that is longer then a single line:
Example:
/info {
//say Operating System [$os Build No. $osbuild]
//say Uptime [$uptime]
//say $icechat
}

/i /info

so, running the command /i returns the following (at the time of writing):

<IceChat9> Operating System  [Windows 7 Build No. 7601] 
<IceChat9> Uptime [1 days 1 mins 38 secs]
<IceChat9> IceChat 9.01 http://www.icechat.net