mIRC Home    About    Download    Register    News    Help

Print Thread
F
FireDivine
FireDivine
F
on *:JOIN:#USF:{
if ($me == StupBot) {
/msg $chan Good for you to join us!
}
}

Is the code I have, is there a way to welcome certain people certain ways?

Also, is there a script that responds to when somebody leaves the IRC?

B
basicer
basicer
B
Sure is, heres an example
Code:
on *:JOIN:#USF:{
if ($me == StupBot) {
  if ( $nick == basicer ) /msg $chan Hey Bas
  else if ( $nick == Cobra ) /msg $chan Look out its Cobra
  else /msg $chan Good for you to join us $nick ! 
}
} 

F
FireDivine
FireDivine
F
Nice, thanks.

F
FireDivine
FireDivine
F
I got this:

on *:PART:#USF:{
if ($me == StupBot) {
/msg $chan Bye bye. v.v
}
}

Which works for when someone leaves the IRC, but something when they QUIT, the bot doesn't resond. How come?

Joined: May 2005
Posts: 449
B
Fjord artisan
Offline
Fjord artisan
B
Joined: May 2005
Posts: 449
Part is different from Quit, so you'll need a remote for both.
Code:
on *:PART:#USF:{
if ($me == StupBot) {
/msg $chan Bye bye. v.v
}
}
on *:QUIT: {
if ($me == StupBot) {
/msg $chan Bye bye. v.v
}
}

F
FireDivine
FireDivine
F
K, thanks.

Joined: Oct 2005
Posts: 1,671
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,671
I don't think that $chan is filled in the onQUIT event, since quits are not specific to any single channel.

-genius_at_work

Joined: Aug 2004
Posts: 7,168
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,168
In a quit event, $chan returns $null

F
FireDivine
FireDivine
F
Yeah that Quit code didn't work.

Joined: Mar 2005
Posts: 420
X
Fjord artisan
Offline
Fjord artisan
X
Joined: Mar 2005
Posts: 420
In a On Quit event, you can use $comchan instead of $chan

Code:
 msg $comchan($nick,1) Bye bye. v.v 


That would message the 1st common channel with the nick that just quit.

D
DaveC
DaveC
D
Just to upgrade your script a slight bit, incase they want groups of nicks replied to in some way

Code:
on *:JOIN:#USF:{
  if ($me == StupBot) {
    if     ($istok(basicer davec robbyrob peter,$nick,32)) { msg $chan Hey you sad sad cases! }
    elseif ($istok(yahoo yabbab yayayaya,$nick,32))        { msg $chan Hey one of the y boys are here! }
    elseif ($istok(zorro,$nick,32))                        { msg $chan Onguard! }
    else { msg $chan Good for you to join us $nick ! }
  }
}

F
FireDivine
FireDivine
F
on *:QUIT: {
if ($me == StupBot) {
if ( $nick == FireDivine ) /msg $comchan($nick,1) $chan NO! DON'T LEAVE ME!
else /msg $comchan($nick,1) LEAVE THEN! See if I care!
}
}

is what I ended up using.

Last edited by FireDivine; 23/03/06 01:01 PM.
D
DaveC
DaveC
D
I would have to check it, but im pretty sure thats a bit pointless, since by the time the server has got a quit message from/caused by the user ($nick) and relayed it to the bot ($me) and then the bot msg's the comchannel (if there is one) that the said user has already QUIT so if not connected to the server anymore.


Link Copied to Clipboard