


What's IAL and what do I need it for?

IAL stands for Internal Address List and it's often needed in scripting. Most of the communication on IRC works on nicknames but sometimes you need to know the full address of user on a same channel with you. The most common case is when you try to ban someone. If your client doesn't know the address, it has to send a request for server and ban only after the server has replied. If the client knows the address, it can set ban right away. You need IAL on many other situations as well.

The IRC server sends the full address of an user on join so the only thing that you have to do to fill the IAL is to get the addresses of people who already are on the channel when you join. You can use many commands like /whois, /who or /userhost. The easiest way is to do /who <channel> every time you join to a new channel.

Example script

on *:JOIN:#: if ( $nick == $me ) who $chan

Note that these commands don't fill IAL right away. To make sure the IAL is filled, restart mIRC or alternatively do /who <channel> for every channel you are on. Next time you join your channels, IAL will be filled automatically.

So what can you do with IAL? The most useful functions are $address and $ialchan. $address(<nick>,5) returns the full address for the nick you specify. For example $address(Geetee,5) might return Geetee! It's even better that you can use all the internal mask types with $address. For example $address(Geetee,3) would return *!*geetee@* which is very often needed when you need to update banlist, exception list, invite list, auto-op list, auto-voice list, etc. Wherever you use address masks, you will probably need $address and IAL.

$ialchan(<mask>,<channel>,<N>) will help with searching the channel for a group of hostmasks. One example would be to scan for *!*@*.uk if you need to do something with the British fellows. Well, more often $ialchan is used to detect and deal with clones - multiple connections from one host.

Example script

; Lists all the users matching the given hostmask on given channel
; Usage: /scan <channel> <hostmask>
alias scan {
  var %x = 1
  while ( $ialchan($2,$1,%x) ) {
    echo -a $ord(%x) match: $ifmatch
    inc %x
