mIRC Home    About    Download    Register    News    Help

Topic Options
#147391 - 18/04/06 02:23 PM Notice when a user with an open query quits
yamaz Offline
Babel fish

Registered: 19/10/03
Posts: 68
Hi there,
I'd need a simple script with these features:

- notices me if a user with which I have an open query quits (in the very same query window)

- does the same if the user re-logs on (and the query window is still open)

with "notice" I don't mean the actual /notice command, but a simple /echo -a smile

How can I do? Thanks

Top
#147392 - 18/04/06 03:19 PM Re: Notice when a user with an open query quits
genius_at_work Offline
Hoopy frood

Registered: 08/10/05
Posts: 1741
Here is a simple version (less accurate when the person connects):
Code:
on *:QUIT:{
  if ($query($nick)) echo $color(quit) -t $nick *** $nick has quit IRC
}
on !*:JOIN:#:{
  if ($query($nick)) echo $color(join) -t $nick *** $nick has joined IRC
}

(untested)


Here is more complex (more accurate) code:
Code:
on *:OPEN:?:*:{ 
  set -u3 $+(%,notify.,$cid,.,$nick) 1
  .notify $nick !query!notify! 
}
on *:CLOSE:?:{
  set -u3 $+(%,notify.,$cid,.,$nick) 1
  .notify -r $nick 
}

on *:NOTIFY:{
  if ($($+(%,notify.,$cid,.,$nick),2)) return
  if ($query($nick)) echo $color(join) -t $nick *** $nick has joined IRC
}

on *:UNOTIFY:{
  if ($($+(%,notify.,$cid,.,$nick),2)) return
  if ($query($nick)) echo $color(quit) -t $nick *** $nick has quit IRC
}

(untested)

-genius_at_work

Top
#147393 - 18/04/06 03:27 PM Re: Notice when a user with an open query quits
yamaz Offline
Babel fish

Registered: 19/10/03
Posts: 68
Thanks a lot

Yes, I managed to do the same thing as the "simple version", but the problem is that if the guy is on two or more channels where I'm too, the message "xxxxxx has joined IRC" is repeated as many times as the number of the channles.

I look forward to use the simple version fixing this problem... any ideas?

Top
#147394 - 18/04/06 07:31 PM Re: Notice when a user with an open query quits
RusselB Offline
Planetary brain

Registered: 03/08/04
Posts: 7252
Loc: Ontario, Canada
add the -a switch to the echo command.

Top
#147395 - 18/04/06 11:01 PM Re: Notice when a user with an open query quits
DaveC Offline
Planetary brain

Registered: 26/09/03
Posts: 4230
doesnt work with echo dude

Top
#147396 - 18/04/06 11:12 PM Re: Notice when a user with an open query quits
DaveC Offline
Planetary brain

Registered: 26/09/03
Posts: 4230
Code:
on !*:JOIN:#:{ if (($query($nick)) && ($comchan($nick,0) == 1)) { echo $color(join) -t $nick *** $nick has joined IRC } }

* code untested *

I checked as someone joined and on the first on join they only had one common channel, so this should cause only one on join to echo anything.

Top
#147397 - 19/04/06 01:27 AM Re: Notice when a user with an open query quits
RusselB Offline
Planetary brain

Registered: 03/08/04
Posts: 7252
Loc: Ontario, Canada
Since when?
From the mIRC help file
Quote:
-a switch echoes to the currently active window.

Top
#147398 - 19/04/06 09:18 AM Re: Notice when a user with an open query quits
DaveC Offline
Planetary brain

Registered: 26/09/03
Posts: 4230
I worded that baddly, I ment using a echo -a doesnt work, as hes trying to get it to appear in the query window (as i understand it)

Top