|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
OP
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
on me:*:nick:{
.titlebar $newnick
}
I wrote this little code so that I could tell quickly, even when mIRC was minimized to the tray, rather than the taskbar, what nick was currently in use. It worked fine with 6.16, however, it doesn't seem to want to work with 6.17 Do I have to change the code so that it'll work with 6.17? If so, how and why?
|
|
|
|
Joined: Feb 2006
Posts: 546
Fjord artisan
|
Fjord artisan
Joined: Feb 2006
Posts: 546 |
looks like a bug with that 'me' prefix guess you gota add that if ($me == $newnick) test ;S
"The only excuse for making a useless script is that one admires it intensely" - Oscar Wilde
|
|
|
|
Joined: Sep 2003
Posts: 4,230
Hoopy frood
|
Hoopy frood
Joined: Sep 2003
Posts: 4,230 |
Check for a custom titlebar alias, and or add a ///ECHO -st ON ME:*:NICK triggered $nick -> $newnick to the start of the event to see if its going off. Becuase your code worked for me (6.17)
--edit--
just double checked with my nick in a channel as well, and then relaisied it isnt triggering at all, really wierd because my nicks in the titlebar already?!?!?!?!?!?! (must be some settings somewhere)
I was missreading what titlebar info i was looking at sorry.
Last edited by DaveC; 25/02/06 05:25 AM.
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
OP
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
There aren't any other titlebar aliases and that's the only ON NICK event I've got (doube & triple checked, even tried removing all other remotes), yet the event isn't running...the echo command isn't coming up either. A solution that I have worked out (although I'd like to know why the original isn't working for me) is on *:nick:{ if ($me == $newnick) { .titlebar $newnick } } While it works, knowing about the me prefix, makes it look messy.
|
|
|
|
Joined: Oct 2005
Posts: 1,741
Hoopy frood
|
Hoopy frood
Joined: Oct 2005
Posts: 1,741 |
It seems that mIRC is updating the value of $me before it executes the on NICK event.
on *:NICK:{
echo -a Me: $me
echo -a Nick: $nick
echo -a NewNick: $newnick
echo -a Raw: $rawmsg
}
Me: [color:green]NickA[/color]
Nick: [color:blue]NickB[/color]
NewNick: [color:green]NickA[/color]
Raw: :[color:blue]NickB[/color]!ident@host.com NICK :NickA
I'm guessing that the "me:" prefix is essentially this code: if ($me == $nick) ;execute event But since $me has already been updated to the value of $newnick, it no longer matches $nick (obviously). -genius_at_work
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
OP
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
I wonder if that's going to break any of the other scripts I have that use the me prefix? Hope not, cause if it does, I'm going back to 6.16 real fast.
|
|
|
|
Joined: Oct 2005
Posts: 1,741
Hoopy frood
|
Hoopy frood
Joined: Oct 2005
Posts: 1,741 |
I don't know if this is a bug as of 6.17 (I don't think I've used the me: prefix on a NICK event personally). If it is a new bug, and my deduction is correct, then I would assume that this would break any "on me:*:NICK:" events. -edit- I just confirmed this in my PnP 4.22 code. The "on me:*:NICK:" event doesn't work on 6.17. If anyone is interested, here is the fix I used:
File: ctcp.mrc
Line: 360
Previous:
on me:*:NICK:{ hadd pnp. $+ $cid -myself $newnick $+ ! $+ $gettok($fulladdress,2-,33) | .timer -mo 1 0 _upd.title }
New:
on *:NICK:{
if (($version == 6.17) && ($me != $newnick)) return
hadd pnp. $+ $cid -myself $newnick $+ ! $+ $gettok($fulladdress,2-,33)
.timer -mo 1 0 _upd.title
}
Reason: mIRC 6.17 Bug prevents "on me:*:NICK:" events from working properly.
-genius_at_work
Last edited by genius_at_work; 25/02/06 06:03 AM.
|
|
|
|
Joined: Dec 2002
Posts: 1,245
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,245 |
I played with what you had too on me*:nick:{ titlebar $newnick } this worked, was the : there in 6.16?
|
|
|
|
Joined: Jul 2003
Posts: 655
Fjord artisan
|
Fjord artisan
Joined: Jul 2003
Posts: 655 |
using on me:*: seems to work fine for other events, just not on nick. me*: works for them all, but this is because it will trigger for everybody
"Allen is having a small problem and needs help adjusting his attitude" - Flutterby
|
|
|
|
Joined: Oct 2005
Posts: 1,741
Hoopy frood
|
Hoopy frood
Joined: Oct 2005
Posts: 1,741 |
I found that using this format allows the existing code to work like previous versions:
on me:[color:red]^[/color]*:NICK:{
}
I'll wait a while, and if no one gives any reason for not using this code, I will post the fixes I used in PnP 4.22. -genius_at_work
|
|
|
|
Joined: Sep 2003
Posts: 4,230
Hoopy frood
|
Hoopy frood
Joined: Sep 2003
Posts: 4,230 |
That would make sence since ^ is before mircs default action, so ya nick hasnt changed yet.
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
OP
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
OP
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
Thanks Genius..I'll keep my eyes open here for further developments
|
|
|
|
Joined: Dec 2003
Posts: 7
Nutrimatic drinks dispenser
|
Nutrimatic drinks dispenser
Joined: Dec 2003
Posts: 7 |
hmmm... just use
on ^1:nick:{ blah blah }
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
OP
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
I'm not familiar with the ^ prefix, and the reason I was using the me prefix is because I only wanted it to change if I changed my nick. But I will give that a try (as was similarily suggested by Genius_at_work)
|
|
|
|
Joined: Oct 2005
Posts: 1,741
Hoopy frood
|
Hoopy frood
Joined: Oct 2005
Posts: 1,741 |
From what I understand, the ^ prefix makes the event trigger before mIRC has done its internal processing, as opposed to regular events which are triggered after mIRC's internal processing. (Anyone correct me if I'm wrong here.) Anyway, here are the changes I made to PnP for anyone who is interested:
File: ctcp.mrc
Line: 360
Previous:
on me:*:NICK:{ hadd pnp. $+ $cid -myself $newnick $+ ! $+ $gettok($fulladdress,2-,33) | .timer -mo 1 0 _upd.title }
New:
on me:^*:NICK:{ hadd pnp. $+ $cid -myself $newnick $+ ! $+ $gettok($fulladdress,2-,33) | .timer -mo 1 0 _upd.title }
Reason: mIRC 6.17 Bug prevents "on me:*:NICK:" events from working properly.
File ctcp.mrc
Line: 481
Previous:
on *:NICK:{
New:
on ^*:NICK:{
Reason: mIRC 6.17 Bug prevents "on me:*:NICK:" events from working properly.
File: dcc.mrc
Line: 362
Previous:
on ^*:NICK:if ($nick == $newnick) return | :loop | if ($fline(@DCCQueue,$nick $+ * $chr(91) $+ $cid $+ $chr(93) $+ *,1)) { rline @DCCQueue $ifmatch $puttok($line(@DCCQueue,$ifmatch),$newnick,1,9) | goto loop }
New:
on ^*:NICK:if ($nick == $newnick) return | :loop | if ($fline(@DCCQueue,$nick $+ * $chr(91) $+ $cid $+ $chr(93) $+ *,1)) { rline @DCCQueue $ifmatch $puttok($line(@DCCQueue,$ifmatch),$newnick,1,9) | goto loop }
Reason: mIRC 6.17 Bug prevents "on me:*:NICK:" events from working properly.
File: protect.mrc
Line: 470
Previous:
on !*:NICK:{
New:
on !^*:NICK:{
Reason: mIRC 6.17 Bug prevents "on me:*:NICK:" events from working properly.
File: away.mrc
Line: 484
Previous:
on me:*:NICK:if ($hget(pnp. $+ $cid,away)) .timer -m 1 0 _upd.away
New:
on me:^*:NICK:if ($hget(pnp. $+ $cid,away)) .timer -m 1 0 _upd.away
Reason: mIRC 6.17 Bug prevents "on me:*:NICK:" events from working properly.
File: nickserv.ppa
Line: 489
Previous:
on me:*:NICK:.timer -m 1 0 .ns auto throttle
New:
on me:^*:NICK:.timer -m 1 0 .ns auto throttle
Reason: mIRC 6.17 Bug prevents "on me:*:NICK:" events from working properly.
File: sound.ppa
Line: 1774
Previous:
on me:*:NICK:_resetleech
New:
on me:^*:NICK:_resetleech
Reason: mIRC 6.17 Bug prevents "on me:*:NICK:" events from working properly.
File: script.mrc
Line: 561
Previous:
on *:NICK:{ if ($nick == $hget(pnp. $+ $cid,-nickrc)) { if ($nick == $me) { hdel pnp. $+ $cid -nickrc | _donretake } | elseif ($nick != $newnick) _retakecheck } | else if (($nick == $me) && ($newnick == $hget(pnp. $+ $cid,-nickretake))) hdel pnp. $+ $cid -nickretake }
New:
on ^*:NICK:{ if ($nick == $hget(pnp. $+ $cid,-nickrc)) { if ($nick == $me) { hdel pnp. $+ $cid -nickrc | _donretake } | elseif ($nick != $newnick) _retakecheck } | else if (($nick == $me) && ($newnick == $hget(pnp. $+ $cid,-nickretake))) hdel pnp. $+ $cid -nickretake }
Reason: mIRC 6.17 Bug prevents "on me:*:NICK:" events from working properly.
File: last.mrc
Line: 700
Previous:
on &*:NICK:{
New:
on &^*:NICK:{
Reason: mIRC 6.17 Bug prevents "on me:*:NICK:" events from working properly.
File: last.mrc
Line: 1047
Previous:
on *:NICK:{
New:
on ^*:NICK:{
Reason: mIRC 6.17 Bug prevents "on me:*:NICK:" events from working properly.
Not all of those events are prefixed with me: , but they use the $nick and $newnick identifiers in some of them. Some of those events are in sections that I rarely (or never) use, so if anyone discovers that the changes I made break the code, post your findings here. -genius_at_work
|
|
|
|
Joined: Sep 2003
Posts: 4,230
Hoopy frood
|
Hoopy frood
Joined: Sep 2003
Posts: 4,230 |
From what I understand, the ^ prefix makes the event trigger before mIRC has done its internal processing, as opposed to regular events which are triggered after mIRC's internal processing. (Anyone correct me if I'm wrong here.) Thats somewhat correct, however in some events some things are already been updated, one i can think of is ... ON ^*:TEXT:*:#:{ echo $chan ********** ********** $nick is about to say something , they have not said anything for $nick($chan,$nick) seconds ********** ********** } That in theory should show the idle time of the nick since he said something, but always replies with zero, since the idle has already been reset by the user saying something, even tho were intercepting the event before mirc displays anything. (this is kinda explained somwehere in the help, in that the ^ triggers before mircs default action on an event or something like that)
|
|
|
|
Joined: Oct 2005
Posts: 1,741
Hoopy frood
|
Hoopy frood
Joined: Oct 2005
Posts: 1,741 |
I guess it wouldn't make sense if the ^ events triggered before any mIRC processing, because then there would be no identifiers available. The only way I could see it being like that is if the ^ events were like using a RAW event, and just the $1- and $rawmsg were set.
It looks like Khaled explained this problem in the related thread in the bug report forum.
-genius_at_work
|
|
|
|
|