mIRC Home    About    Download    Register    News    Help

Print Thread
#16117 20/03/03 12:39 AM
Joined: Mar 2003
Posts: 12
H
Pikka bird
OP Offline
Pikka bird
H
Joined: Mar 2003
Posts: 12
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.

Last edited by Heineken; 20/03/03 12:45 AM.
#16118 20/03/03 12:47 AM
Joined: Dec 2002
Posts: 332
C
Fjord artisan
Offline
Fjord artisan
C
Joined: Dec 2002
Posts: 332
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

Last edited by Cheech; 20/03/03 12:50 AM.
#16119 20/03/03 12:48 AM
Joined: Dec 2002
Posts: 1,527
_
Hoopy frood
Offline
Hoopy frood
_
Joined: Dec 2002
Posts: 1,527
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
}


D3m0nnet.com
#16120 20/03/03 12:55 AM
Joined: Dec 2002
Posts: 332
C
Fjord artisan
Offline
Fjord artisan
C
Joined: Dec 2002
Posts: 332
ok makes sense but why the first if condition ?

#16121 20/03/03 01:33 AM
Joined: Mar 2003
Posts: 12
H
Pikka bird
OP Offline
Pikka bird
H
Joined: Mar 2003
Posts: 12
Thank you! That worked smile

#16122 20/03/03 01:58 AM
Joined: Dec 2002
Posts: 1,527
_
Hoopy frood
Offline
Hoopy frood
_
Joined: Dec 2002
Posts: 1,527
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


D3m0nnet.com
#16123 20/03/03 01:07 PM
Joined: Dec 2002
Posts: 143
A
Vogon poet
Offline
Vogon poet
A
Joined: Dec 2002
Posts: 143
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
}


Aubs.
cool

#16124 20/03/03 10:08 PM
Joined: Dec 2002
Posts: 1,527
_
Hoopy frood
Offline
Hoopy frood
_
Joined: Dec 2002
Posts: 1,527
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


D3m0nnet.com

Link Copied to Clipboard