Access Levels

Suppose you converse in a channel regularly with a few friends. This channel is not exclusive, so other people come in as well. However, you want to treat your friends differently to strangers (by sending them special greeting when they join the channel, or something). Firstly you'd have to tell mIRC who your friends are, and this is done by setting up user masks in the USERS section of remotes.

The first thing to do is learn how IRC in general recognises people on the network. The simple way is by their nickname, but there is no guarantee that people will use the same nickname from one IRC session to the next. A better way of identifying people is by their address, which you can see by performing a /whois command on someone. Now, people's addresses can change, but the trick is to get mIRC to recognise the bits that don't change.

When you do a whois, you will see something like this:

Danny is Danny@usr17-cro.cableinet.co.uk

Parts of this address can change, and parts won't (unless I change ISP's, in which case most of it will change!). The usual way to get mIRC to recognise this user is to specify *!*Danny@*.cableinet.co.uk. Quite often you will have to set up several user masks for the same person, as they use different servers, different IP addresses, even different nicknames sometimes. It will probably take a few weeks to find most of the relevant user masks for one person, and even then there will be times when they come in with something different.

Once you have determined a user mask for a friend, you have to allocate an access level to it. Access levels can be any number you like, but it is usually a good idea to choose numbers with gaps in them, so you can insert new access levels in between later.

The first thing to do is define a series of access levels for people you want to treat differently. For example:

1: everyone not covered below
10: friends
20: close friends
30: channel operators

Then, use the mIRC /guser command to add people to your user list. People have to be on-line when you do this, as mIRC has to be able to pick up their address. Suppose your friend's nickname is Danny, and you want to add him to your list as a friend (level 10). You would type in /guser 10 Danny 3. The 3 at the end specifies the type of mask used by mIRC. From reading other IRC help pages I have discovered that although mIRC's default is type 6, type 3 works in more cases. See the mIRC FAQ (section 7-3-1 Remote Users) for more information on the types of user mask available.

So, we add users to the user list. Examples:

/guser 10 Jim 3
/guser 20 Eric 3
/guser 10 Charlie 3
/guser 30 Phil 3
/guser 10 Bill 3

This sets up Danny, Jim, Charlie and Bill as friends, Eric as a close friend and Phil as a channel operator. Everyone else who joins the channel is automatically set to level 1 access. Now, what can we do with this? Suppose you want to send people a message when they type in a certain word. For this example we'll use the word 'nonsense', although it could be anything you like. When someone else on the channel types in this word you want to send out an automatic response, as follows:
LevelResponse
friendYou should know better
close friendYou REALLY should know better
channel opThe standards in this channel are going through the floor!
everyone elsePlease don't say that word in here

We achieve this by setting up some more remote events, as described above. The events are as follows:

on 1:TEXT:nonsense:#:msg $chan Please don't say that word in here
on 10:TEXT:nonsense:#:msg $chan You should know better
on 20:TEXT:nonsense:#:msg $chan You REALLY should know better
on 30:TEXT:nonsense:#:msg $chan The standards in this channel are going through the floor!

Notice how we've given the relevant access level for each reply. The # in these events indicates that it will only be picked up if people type in the word 'nonsense' in the main channel window. It will not work for a DCC chat (at all, DCC chats are more 'private' in that mIRC can't listen to them!). To pick up the word nonsense said to you in a private chat, change the # to a ?. To pick up what is said in both channels and private chats, substitute * for #.

This will only pick up the word 'nonsense' (on its own, and typed exactly as specified). Some variations are:
nonsense* will trigger if the line started with the word nonsense
*nonsense will trigger if the line ended with the word nonsense
*nonsense* will trigger if the user typed nonsense anywhere on the line. This is probably the most common usage.

mIRC will respond with the highest level command available for that user. For example, suppose we didn't define a response for level 10 users above, and just had:

on 1:TEXT:nonsense:#:msg $chan Please don't say that word in here
on 20:TEXT:nonsense:#:msg $chan You REALLY should know better
on 30:TEXT:nonsense:#:msg $chan The standards in this channel are going through the floor!

All level 10 users will see the level 1 response, because they do not have a high enough access level to trigger the other responses.