mIRC Homepage
Posted By: Rdk ON Nick Event in Mirc - 11/10/03 01:25 AM
It would be nice if the ON Nick event is channel based. The global method makes it very difficult to track which channel the user is on if that user is on several channels your on.
Posted By: Iori Re: ON Nick Event in Mirc - 11/10/03 01:32 AM
This is what the server sends
:nick!identd@some.host NICK :newnick
As you can see, there is no channel parameter involved, you need to loop through $comchan($nick,N).
Posted By: Rdk Re: ON Nick Event in Mirc - 11/10/03 01:35 AM
This is what Ive been doing for the past few years.

However it would be nice if mIRC can capture that event outside the server's action smile

a feature to be considered one day.
Posted By: Iori Re: ON Nick Event in Mirc - 11/10/03 01:40 AM
Well, if you mean if mirc could provide, say $channels, or $targs or such for this and quit etc, then yes it would be nice, and previously suggested too laugh

Edit: Thinking a lil more, you would still need to loop to echo to each window anyway, so...... grin
Posted By: Rdk Re: ON Nick Event in Mirc - 11/10/03 01:43 AM
I forgot bout the On Quit event. grins.

Yes thats exactly what i meant thanks Iori smile

Sits and waits for it to be eventually be coded in so I can remove the loops.

smile
Posted By: cold Re: ON Nick Event in Mirc - 11/10/03 02:20 AM
Well I think mIRC could do that loop internally and just let we use ON *:NICK:<*|?|#[,#]>:{ }. Same with ON QUIT. Shouldn't it be easy to implement since mIRC has all the necessary control to do so?
This would be nice, in my opinion.
Posted By: LocutusofBorg Re: ON Nick Event in Mirc - 11/10/03 09:19 AM
Based on what the on nick and on quit events mean, I don't like this. A nick change is a network wide thing. Your script is gonna get seriously screwed up if you use the following code:

on *:NICK:#: echo $chan $nick changed nick!

if the nick is on two channels that you are on. A simple $comchan loop can echo the line to the right channels, hardcoding this loop into mIRC seems obsolete to me.
Posted By: Skip Re: ON Nick Event in Mirc - 11/10/03 10:06 AM
I agree, however it won't be 'his' script that screws up, but the many scripts written with the old event in mind. mIRC seems to have a hard-coded list of the number of parameters that each event takes, this is why we can have 'on *:blah:whatever:/this is the alias' and mIRC knows where to begin execution of the script. Changing how many parameters on NICK takes would break every script that uses the event.

This could also cause headaches for people that want to catch the on-nick event for something totally unrelated to a channel, for example:

Code:
on *:nick:*:{ echo -s In case you didnt notice, $nick is now known as $newnick }


How many times would this trigger?
Posted By: Raccoon Re: ON Nick Event in Mirc - 11/10/03 07:20 PM
I'm guessing the original poster was thinking more along the lines of having On NICK and On QUIT trigger once per every channel you and $nick share.

This of course would have a problem of triggering the event multiple times for non-channel related events, so something would have to be added perhaps to identify how the event is going to be used. I'm not saying I support this idea, but this is one way I'd go about it if I were Khaled.

On *:NICK: <-- This triggers once and only once per nick change.

On *:NICK:#: <-- This triggers $comchan($nick,0) times, once for every channel you share.

On *:NICK:#mIRC,#irchelp,#helpdesk: <-- triggers 1 to 3 times, depending on how many of these chans he's on.

So basically, if no # event parameter is present, it works like it currently does. If a # event parameter is present, it triggers for all relative channels and populates the $chan identifier each time around.

The same can be done for QUIT too.
On *:QUIT:#mIRC: <-- Triggers only if $nick is in #mIRC, then populates $chan as necessary.

- Raccoon
Posted By: cold Re: ON Nick Event in Mirc - 12/10/03 12:52 PM
This was exactly what I had in mind.
© mIRC Discussion Forums