mIRC Homepage
Posted By: yamaz Notice when a user with an open query quits - 18/04/06 01:23 PM
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
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
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?
add the -a switch to the echo command.
doesnt work with echo dude
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.
Since when?
From the mIRC help file
Quote:
-a switch echoes to the currently active window.
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)
© mIRC Discussion Forums