Aliasing Plugin

The Aliasing plugin provides a feature called aliasing. Aliasing is where you instruct IRCmagic to modify text typed in Ircle's Inputline window. Using this feature, you can simplify most any command that you would normally type out into ircle's input line. In other words you can create "shortcuts" to long commands.

To enable or disable this feature, type the following into any Ircle window, or click the Settings button in the IRCmagic Main Window.

/aliasing on
/aliasing off

To change Aliasing settings, type the following into any Ircle widow, or click the appropriate button in the IRCmagic Main Window.

/aliasing

The following window is displayed:

Enable the Display Aliasing notifications checkbox if you would like to see messages showing the "before and after" aliased text as it is processed by the Aliasing plugin.

How aliasing works

At startup, the Aliasing plugin looks for files named "IRCmagic Aliases" and "User Aliases" in the IRCmagic Folder. We ask that you do not modify the "IRCmagic Aliases" file - but you can open it to look at it if you want. The "User Aliases" file is for your own use. You are free to do what you want with it.

The format of these files is simple:

Be sure to include both a search line and a replace line. If you fail to do this, IRCmagic's aliasing function may not work correctly.

The simplest example alias entry

The simplest alias entry is one that does not use Regular Expression. For example, let's say that you wanted IRCmagic to change: "back" to "/ungone" whenever you type it. To accomplish this, you would add the following to the "User Aliases" file:

back

/ungone

The first line looks for any line of text that contains "back".

The second line replaces the line of text with "/ungone".

A more complex example alias entry

Let's say that you wanted IRCmagic to change: "/hug nickname" to "/me hugs {{{{{{{nickname}}}}}}}" whenever you type it. To accomplish this, you would add the following to the "User Aliases" file:

^/hug[ ]+([^ ]+)

/me {{{{{{{\1}}}}}}}

The first line uses Regular Expressions to look for any line of text that starts with "/hug", followed by one or more spaces ([ ]+), followed by any number of non-space characters (([^ ]+)). Since the "any number of non-space characters" part is in parenthesis, that part of the text is remembered for use in the replace line.

The second line replaces the line of text with "/me {{{{{{{", followed by the part of the first line that was in parenthesis and remembered (\1), followed by "}}}}}}}".

An even more complex example alias entry

Let's say that you wanted IRCmagic to change: "/m nickname message" to "/msg nickname message" whenever you type it. To accomplish this, you would add the following to the "User Aliases" file:

^/m[ ]+([^ ]+)[ ]+(.+)
/msg \1 \2

The first line uses Regular Expressions to parse out and store the nickname and message parts of the text in parenthesis.

The second line replaces the "/m" with "/msg", and again using Regular Expressions inserts the two stored blocks of text into a new line of text.

This alias entry is included in the "IRCmagic Aliases" file installed with your IRCmagic package.

Aliasing credits

IRCmagic's Regular Expression capability makes use of the RegEx Commands scripting addition, which is a freeware software package. Regular Expression support allows you to do really powerful text manipulation. Please see the documentation that came with RegEx Commands for more information on how to use Regular Expressions. The entire package, is located within the "Other Software Packages" folder in your IRCmagic Folder. Email links to the authors of RegEx Commands and the URL to download the package can be found at the bottom of this document. More documentation on Regular Expressions (also referred to as regex, or grep) can be obtained in many places on the internet.