mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Feb 2006
Posts: 47
F
Ameglian cow
OP Offline
Ameglian cow
F
Joined: Feb 2006
Posts: 47
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?

Joined: Oct 2003
Posts: 88
B
Babel fish
Offline
Babel fish
B
Joined: Oct 2003
Posts: 88
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 ! 
}
} 


Basicer - Windows 7 Business x86
Joined: Feb 2006
Posts: 47
F
Ameglian cow
OP Offline
Ameglian cow
F
Joined: Feb 2006
Posts: 47
Nice, thanks.

Joined: Feb 2006
Posts: 47
F
Ameglian cow
OP Offline
Ameglian cow
F
Joined: Feb 2006
Posts: 47
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
Fjord artisan
Offline
Fjord artisan
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
}
}

Joined: Feb 2006
Posts: 47
F
Ameglian cow
OP Offline
Ameglian cow
F
Joined: Feb 2006
Posts: 47
K, thanks.

Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
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,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
In a quit event, $chan returns $null

Joined: Feb 2006
Posts: 47
F
Ameglian cow
OP Offline
Ameglian cow
F
Joined: Feb 2006
Posts: 47
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.


If you have a plastic floor runner over your tiles, then you're one Hella Pinoy!
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
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 ! }
  }
}

Joined: Feb 2006
Posts: 47
F
Ameglian cow
OP Offline
Ameglian cow
F
Joined: Feb 2006
Posts: 47
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.
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
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