mIRC Homepage
Posted By: Heineken Quit Message - 20/03/03 12:39 AM
I'm currently working on writing a script for myself. I am making a totally new look and feel to it. So here's my question: When a person quits, how can I find out which channel they quit? I want to display a message in the channel that they quit.

So far i have:

on *:QUIT:{ echo $timestamp 14 $+ $nick 5has quit IRC (14 $1- 5). }

how can i echo it in the channel they quit?

Thx!

Edit: what i have so far works except that it shows it in the server window.
Posted By: Cheech Re: Quit Message - 20/03/03 12:47 AM
you could try using $chan however i am not sure if that will work if they are on more than one channel that you are on if it doesnt you may try $comchan never tryed either one in that format hope it helps

ok i dint think i understood the question you want to echo it to the channel that the event occured in ? if so i am still not sure but you would need to return the channel and set it to a variable then echo that channel
Posted By: _D3m0n_ Re: Quit Message - 20/03/03 12:48 AM
Code:
on ^1:quit:{
  if ($1-) var %reason = ( $+ $1- $+ )
  var %i = 1
  while ($comchan($nick,%i)) {
    echo $color(quit) -ti2 $ifmatch * 14 $+ $nick 5has quit IRC ( 15 $+ %reason $+ )
    inc %i
  }
  halt
}
Posted By: Cheech Re: Quit Message - 20/03/03 12:55 AM
ok makes sense but why the first if condition ?
Posted By: Heineken Re: Quit Message - 20/03/03 01:33 AM
Thank you! That worked smile
Posted By: _D3m0n_ Re: Quit Message - 20/03/03 01:58 AM
so that it posts a quit message only if there is one ..... that way it doesnt try to post something that isnt there and give an error
Posted By: Aubs Re: Quit Message - 20/03/03 01:07 PM
Your code puts two ()'s

If I quit without a message you would get:
* Aubs has quit IRC ()

If I quit with a message you would get:
*Aubs has quit IRC ((Bye Bye))

Try these for example:
Code:
//tokenize 32 One Two Three | echo -a $1 $2 $3 ( $+ $4 $+ )
//tokenize 32 One Two Three Four | echo -a $1 $2 $3 ( $+ $4 $+ )
In the first one, there's no $4 so it ignores it, whereas in the second, there is so it uses it.


Code:
on ^*:quit:{
  var %i = 1
  while ($comchan($nick,%i)) {
    echo $color(quit) -ti2 $ifmatch *14 $nick has quit IRC (15 $+ $1- $+ )
    inc %i
  }
  halt
}
Posted By: _D3m0n_ Re: Quit Message - 20/03/03 10:08 PM
ok u are correct ..... in mine i use its differerent as i only edited it up to read what his was ..... to fix that part i should have set my var %reason to = $1- instead of ( $+ $1- $+ )
that way iot would have only included one set of quotes ..... or remove the set from the actual quit message line and make it read

echo $color(quit) -ti2 $ifmatch *14 $nick has quit IRC 15 $+ %reason

and leave it at that then u dont have empty quotes at all ...... but to each is own i was just giving a quick example for them to use ... its not exactly what i have and mines totally different it provides user count on parts joins and quits
© mIRC Discussion Forums