Aliases

From IceChat Wiki
Jump to: navigation, search

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


$+
If you need to join $1 and $2, $1$2 would not work. You would join them together with $+.
So it would be $1 $+ $2 . The spaces between will be automatically removed.