Jump to content

Using $ial effectively


Cleric xtx

Recommended Posts

A lot of times, people have problems typing in nicknames for their script to understand. This is where $ial comes in very handy.

 

I'll use a remote command as an example:

on admin:text:@+q*:#:{ mode # +q $2- }

The above code will make the specified nickname an owner but only if the specified nickname matches mIRC's exaclty:

If the nickname was Jon the script would make Jon an owner.

If the nickname was Jõŋ then the script probably wouldn't do it.

 

Here is the same code rewritten to use the $ial command:

on admin:text:@+q*:#:{ mode # +q $ial(* $+ $2- $+ *).nick }

Using that command the user can specify one or more letters at the beginning, middle or end of the nickname.

If the user specifies J then the script will pick up the first nickname with a J in it.

If the user specifies Jo then the script will pick up the first nickname with Jo in it.

etc...

 

You may want to adapt on the command, however, to make it more versitile:

on admin:text:@+q*:#:{
 if ($chr(42) !isin $2-) { var %n = * $+ $2- $+ * | goto n }
 else { var %n = $2- | goto n }
 :n
 mode # +q $ial(%n).nick
}

With the above code, you can specify which part of the nickname you are referring to.

If the user specifies Jo* then it will pick up the first nickname starting with Jo.

If the user doesn't include an asterix then it will pick up the first nickname with Jo in it.

etc...

 

You can also retrieve gatekeepers in a similar way, by using .addr instead of .nick. Without either of the props the script will return the specified nickname's full gatekeeper (eg: nick!gkp@domain).

 

All of the other information you should need about $ial can be found in mIRC's help file:

$ial(nick/mask,N)

Returns the Nth address matching nick or mask in the Internal Address List.

 

Properties: nick, user, host, addr, mark

 

$ial(*!*@*.com,0) returns the total number of addresses in the IAL matching *!*@*.com

 

$ial(*!*@*.com,3) returns the 3rd address in the IAL matching *!*@*.com

$ial(*!*@*.com,4).nick returns the nick of the 4th matching address ending in .com

$ial(*!*@*.com,4).user returns the userid of the 4th matching address ending in .com

 

To scan each address in the IAL you can use $ial(*,N).

 

The N parameter is optional, defaults to 1 if not specified.

Mark is used in conjunction with the /mark alias to retrieve the specified text:

/ialmark <nick> [text]

Marks the IAL entry for a nickname with the specified text.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...