mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2004
Posts: 15
J
jONEz Offline OP
Pikka bird
OP Offline
Pikka bird
J
Joined: Jan 2004
Posts: 15
For my bot I need to trap all user events, I have nick, join, part, and lots of text ones working but these two don't seem to respond or I'm not using them correctly. I checked the FAQ on here for syntax and this is what I have:

on 1:DISCONNECT:{
msg $chan 9«« Ooops... $nick lost the connection. »»
}

on 2:QUIT:{
msg $chan 9«« Goodbye $nick !! »»
}

There's more too it then that of course but that exact msg code works fine in the other events leading me to believe the first line isn't correct, what am I doing wrong? Thanks!

Last edited by jONEz; 25/01/04 02:38 AM.
Joined: Dec 2003
Posts: 261
M
Fjord artisan
Offline
Fjord artisan
M
Joined: Dec 2003
Posts: 261
Hi, there. Let's see what help has to say about that:

1. The on DISCONNECT event ... and triggers when YOU quit or are disconnected from an IRC Server.

2. The on QUIT event triggers when a USER quits IRC while on the same CHANNEL as you.

So, from 1. and 2. => You can use $chan when using on quit, but not when using on disconnect.
Hope that helped a bit. cool


velicha dusha moja Gospoda
Joined: Jan 2004
Posts: 15
J
jONEz Offline OP
Pikka bird
OP Offline
Pikka bird
J
Joined: Jan 2004
Posts: 15
Thanks for the info on disconnect, it turns out I don't need that after all *lol* My quit event doesn't work however, is that supposed to be a on 1:QUIT or on 2:QUIT? When people quit the channel it doesn't display that message.

Thanks for the help btw!

Joined: Dec 2003
Posts: 261
M
Fjord artisan
Offline
Fjord artisan
M
Joined: Dec 2003
Posts: 261
Well, if you want to use on quit for every user (all levels) use this:

on *:quit:
or
on 1:quit:

if you need it for users with the level >2, use

on 2:quit:


velicha dusha moja Gospoda
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
There is no $chan associated with quit events, this is what the server sends when a user quis.
  • :nick!identd@blah.host.net QUIT :Reason
What this means is that you have to loop through all common channels with $comchan()
Code:
on *:quit:{
  var %i = 1
  while $comchan($nick,%i) {
 
    msg $ifmatch 9«« Goodbye $nick !! »»
 
    inc %i
  }
}
/help $comchan

Joined: Dec 2003
Posts: 261
M
Fjord artisan
Offline
Fjord artisan
M
Joined: Dec 2003
Posts: 261
You are RIGHT! blush
Sorry, for any troubles that I did with my posts... mad

thanx for the truth, Iori!


velicha dusha moja Gospoda
Joined: Jan 2004
Posts: 15
J
jONEz Offline OP
Pikka bird
OP Offline
Pikka bird
J
Joined: Jan 2004
Posts: 15
Thanks Iori! Will that $comchan loop print the msg to all the channels he was connected to or just the current channel the bot is in?

Thanks again both of you!

Edit* I found this and it answered my question, thanks again for the help guys!

$comchan(Nick,N) identifier, returns channels which both you and Nick are on. $comchan(Nick,N).op returns $true if you're an Op on that channel.

Last edited by jONEz; 25/01/04 08:26 PM.

Link Copied to Clipboard