mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2003
Posts: 261
M
milosh Offline OP
Fjord artisan
OP Offline
Fjord artisan
M
Joined: Dec 2003
Posts: 261
Hi to you all. I have this code in order to inform me when somebody says my nick and I am not looking into that channel.

on *:text:*:#:{ if (( $me isin $1- ) && ( $me != $nick ) && ( $active != $chan )) { /echo -a Info: $nick ( $chan ): $1- } }

But, if I have nick her example, and somebody says: Where are you, bla bla bla... script will inform me that somebody called my nick, which is not the case. I need some help here.
Thanx!


velicha dusha moja Gospoda
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
on *:TEXT:*:#: { if (($istok($1-,$me,32)) && ($chan != $active)) { /echo -a Info: $nick ( $chan ): $1- }

The if ($nick != $me) is not neccesary, text triggers don't affect you.
istok makes sure your name is listed as a word, not in something.


-KingTomato
Joined: Dec 2003
Posts: 261
M
milosh Offline OP
Fjord artisan
OP Offline
Fjord artisan
M
Joined: Dec 2003
Posts: 261
Thanx man. You helped me. grin It's working just fine. Also, thanx for the one about $nick != $me... I removed it from a couple lines wink


velicha dusha moja Gospoda
Joined: Apr 2003
Posts: 701
K
Hoopy frood
Offline
Hoopy frood
K
Joined: Apr 2003
Posts: 701
Note however that "hi milosh!" won't trigger either, because there's a ! attached to it. If someone decides to change color halfway your nick, it won't trigger either.

A way to fix these problems can be if ($regex($1-,/\bmilosh\b/S)) ...
The \b means word boundary, the S switch at the end means strip all color codes in the match text first.

Joined: Dec 2003
Posts: 261
M
milosh Offline OP
Fjord artisan
OP Offline
Fjord artisan
M
Joined: Dec 2003
Posts: 261
Thanks. It works just as you said. Ofcourse I used $me instead of milosh: if $regex($1-,/\b $+ $me $+ \b/S).


velicha dusha moja Gospoda

Link Copied to Clipboard