mIRC Home    About    Download    Register    News    Help

Print Thread
#90268 12/07/04 06:16 PM
Joined: Jun 2004
Posts: 139
N
Ninko Offline OP
Vogon poet
OP Offline
Vogon poet
N
Joined: Jun 2004
Posts: 139
Hi there,
I'm just wondering, if it is possible to have something be triggered by only one person, rather then using a user level where there might be a few users on that level, can it be set to trigger by their nick or their ident so only they can trigger that response. If it is possible, how?

Thanks smile

#90269 12/07/04 07:06 PM
Joined: Dec 2002
Posts: 788
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 788
if ($nick == nickname) { commands }
Eamonn.

#90270 13/07/04 08:48 PM
Joined: Jun 2004
Posts: 139
N
Ninko Offline OP
Vogon poet
OP Offline
Vogon poet
N
Joined: Jun 2004
Posts: 139
So how would that fit into the following code:

on *:JOIN:*:{
/msg # Welcome $nick to the room smile
}

Also rather then using their nick as they can change that, is it possible to responde on their address?

Thanks smile

#90271 13/07/04 10:49 PM
Joined: Dec 2002
Posts: 774
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Dec 2002
Posts: 774
That's exactly what user levels are for...

and stop using that blue text
k, thx, bye


Code:
//if ( khaled isgod ) echo yes | else echo no
#90272 14/07/04 01:36 AM
Joined: Jun 2003
Posts: 5,024
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Jun 2003
Posts: 5,024
It may look a little something like this:

on *:JOIN:#:{
if ($nick == Nickname)
msg # Welcome $nick to the room :-)
}

You should change Nickname to the nickname you wish to detect. Note the #, you should use this to make this occur on ALL channels the person joins. If you only want it to activate on one channel, use #channel instead of #, where #channel is the channel name.

To detect the address, you may want to use $site or $address. The difference? Well, $site detects the hostname/IP - whatever comes after the @ symbol. So if the [email]user@host[/email] is arnie@mirc.mascot.com then $site is 'mirc.mascot.com'. If he uses a static IP or hostname, you can use this easily:

on *:JOIN:#:{
if ($site == mirc.mascot.com) {
msg # Welcome $nick to the room :-)
}
}

However, in the case of a dial-up user or indeed depending on the ISP they use, their hostname may change. So say you wanted to check if the person has 'mascot.com' ANYWHERE in their hostname. In the above example, the bit after the @ must be exactly mirc.mascot.com. If you want to detect if it's anywhere, you use 'iswm' which means is wildcard match:

on *:JOIN:#:{
if (*mascot.com* iswm $site) {
msg # Welcome $nick to the room :-)
}
}

However, this may prove to detect too many people so you might use something like $address. As a simple example, let's say the [email]user@host[/email] is trout@slaps.people.around.a.bit :

on *:JOIN:#:{
if (trout@*.around.a.bit iswm $address) {
msg # Welcome $nick to the room :-)
}
}

More help can be found with:

/help $site
/help $address
/help if then else
/help on join


Of course, you may find it easier to use Access Levels as was suggested - they're just as simple as the above. See /help access levels.

Hope this has been helpful!

Regards,


Mentality/Chris
#90273 15/07/04 08:38 AM
Joined: Jun 2004
Posts: 139
N
Ninko Offline OP
Vogon poet
OP Offline
Vogon poet
N
Joined: Jun 2004
Posts: 139
Ok, thanks very much, that info was very useful smile


Link Copied to Clipboard