mIRC Home    About    Download    Register    News    Help

Print Thread
#200218 30/05/08 12:49 AM
Joined: Nov 2004
Posts: 842
Jigsy Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Nov 2004
Posts: 842
Would anybody know why this code is refusing to work?

Code:
on !*:unotify:{
  if (($nick == $mnick) && ($me != $mnick) && (!%awaymsg)) { nick $mnick }
}


Every time I change my nick from my main nick on one specific network, it negates it, and forces me back to my main nick. However, I tried it on two others and it had no problems.


What do you do at the end of the world? Are you busy? Will you save us?
Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
The networks may deliver different messages for the notify commands. Try enabling /debug and see if the messages vary from one network to the others. The problem network may report that you have changed your nick, whereas the other may not (since you know when you have changed your nick).

I don't know if the ^ prefix is applicable for the onUNOTIFY event, but if so, it may help in this case.

-genius_at_work

Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
Seems to work just as you described it to me.

For some $me = $mnick = bob:

1. You change your nick to `steve`
2. Server replies "you changed your nick to `steve`". $me is now `steve`.
3. on UNOTIFY triggers because `bob` has left IRC
4. (Remember $me = steve).. if ($nick == bob && steve != bob) => true.
5. It should execute /nick $mnick, ie. /nick bob.

As genius mentioned, the order is the reason some networks may trigger this and others may not (events 2 and 3 may be interchanged)-- but frankly, your code does not specify otherwise, so its working "fine" by my account.. it just isn't what you want. You need to add a guard to be sure "bob" didn't leave irc because of you. You can do this with an ON NICK event:

on *:NICK:if ($nick == $me && $me == $mnick && $newnick != $mnick) set %unotify $+ $cid $true

Then make sure that variable does not exist when UNOTIFY triggers (make sure to unset it, too).


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: Nov 2004
Posts: 842
Jigsy Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Nov 2004
Posts: 842
Yeah, I've done that for now.

As for the IRCd thing, I'd find that confusing because the other two are the same IRCd. :X


What do you do at the end of the world? Are you busy? Will you save us?
Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
Are they the same version? With all the same addons (and the same versions of addons)? Who knows what changes were made from one version of an IRCd to the next, or what a specific addon may do to the output strings from the server.

-genius_at_work

Joined: Nov 2004
Posts: 842
Jigsy Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Nov 2004
Posts: 842
It's an older version. ;X


What do you do at the end of the world? Are you busy? Will you save us?

Link Copied to Clipboard