mIRC Homepage
Posted By: RusselB mIRC 6.17 problem or broken code? - 25/02/06 04:44 AM
Code:
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?
Posted By: jaytea Re: mIRC 6.17 problem or broken code? - 25/02/06 05:13 AM
looks like a bug with that 'me' prefix frown guess you gota add that if ($me == $newnick) test ;S
Posted By: DaveC Re: mIRC 6.17 problem or broken code? - 25/02/06 05:19 AM
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.
Posted By: RusselB Re: mIRC 6.17 problem or broken code? - 25/02/06 05:37 AM
mad 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
Code:
 on *:nick:{ if ($me == $newnick) { .titlebar $newnick } }


While it works, knowing about the me prefix, makes it look messy.
Posted By: genius_at_work Re: mIRC 6.17 problem or broken code? - 25/02/06 05:48 AM
It seems that mIRC is updating the value of $me before it executes the on NICK event.

Code:
on *:NICK:{
  echo -a Me: $me 
  echo -a Nick: $nick 
  echo -a NewNick: $newnick
  echo -a Raw: $rawmsg
}



Code:
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
Posted By: RusselB Re: mIRC 6.17 problem or broken code? - 25/02/06 05:51 AM
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.
Posted By: genius_at_work Re: mIRC 6.17 problem or broken code? - 25/02/06 05:53 AM
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:

Code:
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
Posted By: MikeChat Re: mIRC 6.17 problem or broken code? - 25/02/06 06:19 PM
I played with what you had too
on me*:nick:{
titlebar $newnick
}
this worked, was the : there in 6.16?
Posted By: Om3n Re: mIRC 6.17 problem or broken code? - 25/02/06 07:12 PM
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
Posted By: genius_at_work Re: mIRC 6.17 problem or broken code? - 26/02/06 01:34 AM
I found that using this format allows the existing code to work like previous versions:

Code:
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
Posted By: DaveC Re: mIRC 6.17 problem or broken code? - 26/02/06 07:06 AM
That would make sence since ^ is before mircs default action, so ya nick hasnt changed yet.
Posted By: RusselB Re: mIRC 6.17 problem or broken code? - 26/02/06 07:34 AM
Yes it was there in 6.16
Posted By: RusselB Re: mIRC 6.17 problem or broken code? - 26/02/06 07:36 AM
Thanks Genius..I'll keep my eyes open here for further developments
Posted By: virii Re: mIRC 6.17 problem or broken code? - 26/02/06 12:33 PM
hmmm... just use

on ^1:nick:{ blah blah }
Posted By: RusselB Re: mIRC 6.17 problem or broken code? - 26/02/06 07:56 PM
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)
Posted By: genius_at_work Re: mIRC 6.17 problem or broken code? - 26/02/06 11:25 PM
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:

Code:
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.

Code:
File ctcp.mrc

Line: 481

Previous:
on *:NICK:{

New:
on ^*:NICK:{

Reason: mIRC 6.17 Bug prevents "on me:*:NICK:" events from working properly.

Code:
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.

Code:
File: protect.mrc

Line: 470

Previous:
on !*:NICK:{

New:
on !^*:NICK:{

Reason: mIRC 6.17 Bug prevents "on me:*:NICK:" events from working properly.

Code:
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.

Code:
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.

Code:
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.

Code:
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.

Code:
File: last.mrc

Line: 700

Previous:
on &*:NICK:{

New:
on &^*:NICK:{

Reason: mIRC 6.17 Bug prevents "on me:*:NICK:" events from working properly.

Code:
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
Posted By: DaveC Re: mIRC 6.17 problem or broken code? - 27/02/06 06:55 AM
Quote:
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)
Posted By: genius_at_work Re: mIRC 6.17 problem or broken code? - 27/02/06 02:46 PM
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
© mIRC Discussion Forums