mIRC Homepage
Posted By: FireDivine Welcome Message script question. - 23/03/06 04:03 AM
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?
Posted By: basicer Re: Welcome Message script question. - 23/03/06 04:08 AM
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 ! 
}
} 
Posted By: FireDivine Re: Welcome Message script question. - 23/03/06 04:11 AM
Nice, thanks.
Posted By: FireDivine Re: Welcome Message script question. - 23/03/06 04:23 AM
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?
Posted By: bwr30060 Re: Welcome Message script question. - 23/03/06 04:35 AM
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
}
}
Posted By: FireDivine Re: Welcome Message script question. - 23/03/06 04:41 AM
K, thanks.
Posted By: genius_at_work Re: Welcome Message script question. - 23/03/06 04:47 AM
I don't think that $chan is filled in the onQUIT event, since quits are not specific to any single channel.

-genius_at_work
Posted By: RusselB Re: Welcome Message script question. - 23/03/06 05:48 AM
In a quit event, $chan returns $null
Posted By: FireDivine Re: Welcome Message script question. - 23/03/06 05:49 AM
Yeah that Quit code didn't work.
Posted By: xDaeMoN Re: Welcome Message script question. - 23/03/06 06:01 AM
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.
Posted By: DaveC Re: Welcome Message script question. - 23/03/06 10:00 AM
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 ! }
  }
}
Posted By: FireDivine Re: Welcome Message script question. - 23/03/06 12:56 PM
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.
Posted By: DaveC Re: Welcome Message script question. - 23/03/06 07:09 PM
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.
© mIRC Discussion Forums