Greet Script

By mitch21236 on Aug 15, 2010

Simple Random Greet Script

on *:JOIN:#: {
  set %rand $r(1,5) {
    if (%rand == 1) { msg $chan $nick, Hey $nick }
    if (%rand == 2) { msg $chan $nick, Hello $nick }
    if (%rand == 3) { msg $chan $nick, Hey $nick How are you today? }
    if (%rand == 4) { msg $chan $nick, Whatsup $nick ? }
    if (%rand == 5) { msg $chan $nick, Hi $nick }
  }
} 

Comments

Sign in to comment.
gooshie   -  Aug 17, 2010

For the benefit of mitch21236
In the original script, extra brackets, $chan and use of set variable.

on *:JOIN:#: {
  var %rand $r(1,2)
  if (%rand == 1) { msg # $nick, Hey $nick }
  if (%rand == 2) { msg # $nick, Hello $nick }
}
 Respond  
napa182   -  Aug 16, 2010

well now you have seen diff ways of going about it...

 Respond  
mitch21236   -  Aug 16, 2010

i was just making it simple, im a noob, i dont script much

 Respond  
WorldDMT   -  Aug 16, 2010

no need to regex only tokenize can do it

on !*:join:#:{
  tokenize 124 hey|hello|how are you today|whatsup|hi
  msg # $nick $+ , $(,$+($,$r(1,$0)))
}
 Respond  
Jethro   -  Aug 16, 2010

I was fiddling around with regex and this seems to do it too:

on !*:join:#:{
  var %r = hey|hello|how are you today|whatsup|hi
  tokenize 124 $regsubex(%r,/( $+ %r $+ )/gi,$regml($r(1,\0)))
  msg # $nick $+ , $1
}
 Respond  
Jethro   -  Aug 16, 2010

I knew someone else was going to suggest the use of $gettok. lol

 Respond  
napa182   -  Aug 16, 2010

you could have done something like this

on !*:JOIN:#: {
  msg # $gettok(Hey|Hello|How are you today?|Whatsup|Hi,$r(1,5),124) $nick
}

maybe add some kind of flood pro to it.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.