IRC Scripting Basics: Part 2

By Richard “GameGuru” Grant

Before I start the 2nd Tutorial, I will show how to perform a ban & kick in an alias

/bk {
   /mode # +b $$1
   /kick # $$1
}

This is probably the simplest form of the alias possible, there are many improvements that can be made, we could have checked for operator status first, asked for a reason for the ban, banned the user address rather than nickname, and so on.

Popups

Popups are to Aliases what GUI’s are to CLI’s. Popups work similarly to aliases except that popups involve the use of the mouse rather than typing. Loading up your popups file (using Alt + P or accessing its tab from the Scripts Editor) you will find some popups already created for you.

Popups are separated into 5 sections detailed below (click on View in the Script Editor window to see each one).

Status:
This is the first window that can be viewed in mIRC, it contains all server information is also a place where information and messages are when they come from an unknown origin.
Channel:
The channel window is the window where the channel chat is displayed, by default this only contains one popup command “Channel Modes” which is used to see the information on the channel.
Query:
These popups are displayed when in a DCC Chat or Query Session (Private Chat) and usually contain commands for working with the user you are conversing with.
Nick List:
These popups are used in the side listbox of each channel, where people’s nicknames are located, these tend to be where most of the popup commands are located.
Menu Bar:
This is the only popup not summoned with the right mouse button. It is located in the toolbar. The default name “Commands” can be changed by changing the text in the first line of this section.

The default structure for popups are shown below:

Menu
.Submenu
..Sub-Submenu
...Label:commands
- Separator

The menu will be the first list you see when right clicking in the popup area, then each submenu will appear when the mouse is placed on the parent menu. The label for the popup is displayed on the popup, and when clicking on it, its associated commands are performed. To ease categorising of commands a separator can be used for breaking down sections of the popup. To show this more simply I will take an example from standard mIRC’s popup file.

Control .Ignore:/ignore $$1 1

This code is located in the Nickname list popup section. Before it there is a separator, to separate it from the UCentral, Whois and Query commands, then a menu called “Control” is made, which expands to reveal a list of commands used for control of users, the first being “Ignore”. If you were to click on this it would perform the command “/ignore $$1 1″ where $$1 is the selected user in the nickname list. This is the basis on how popups work. Note that you cannot attach commands to parent menus which create a submenu, i.e.

Actions:/me performs an action
.Spade slap:/me slaps someone with a spade

The “Actions” Popup will not perform a command as intended, it will merely display “Actions:/me performs an action” instead.

It is also possible to create shortcuts to menus by underlining a certain letter as the shortcut key to it, take this example:

&User Options
.&Positive Actions
..&Op:/mode # +o $$1
.&Negative Actions
..&Deop:/mode # -o $$1

If you were to place this code in your Nick List section of your popups file, you would find that you could op a user by right clicking then pressing “UPO” this is much the same as toolbar shortcuts (the most common being Alt+f then s for Save)

This concludes the Popup tutorial, try experimenting with creating popup actions and messages and keeping them sorted in sections.