WOrd replier

By romen on Feb 27, 2010

Paste it in you bot's remote script and it replies something you say like this
Example :
Rico : Lol
ColeBot : Rico is Laughing out loud

on *:TEXT:*:#: {
  if (lol isin $1) msg $chan 2,11 $nick is LAUGHING OUT LOUD
  if (rofl isin $1) msg $chan 2,11 $nick is ROLLING ON THE FLOOR LAUGHING
  if (Hi isin $1) msg $chan 2,11 Hello
  if (hello isin $1) msg $chan 2,11 Hi
  if (BRB isin $1) msg $chan 2,11 $nick will BE RIGHT BACK in a mooment
  if (Away isin $1) msg $chan 2,11 $nick is currently AWAY and will be back in a moment
  if (Im back isin $1) msg $chan 2,11 $nick is BACK from being away or BRB
}

Comments

Sign in to comment.
Jethro   -  Feb 28, 2010

Ghost-writer, as the author of the script mainly wants the acronyms to trigger by themselves, and not the rest of words following them, you should use:> if (Im back isin $1-2)To represent $1 and $2

 Respond  
Ghost-writer   -  Feb 28, 2010

$1 != $1-, use $1-

 Respond  
PuNkTuReD   -  Feb 28, 2010

no one mentioned that Im Back cant be isin $1 etc with others

 Respond  
Jethro   -  Feb 28, 2010

Aucun50, I mentioned that I was "experimenting" with regex to relate to what romen has done. As xDaeMoN pointed out, there's no flood control but a trigger control I suggested. Please read closely before making a constructive criticism.

 Respond  
xDaeMoN   -  Feb 28, 2010

@ Aucun50, there is no flood control on Jethro_'s code. He was suggesting to the to romen to add a trigger flood control.

I have a similar script to this but all you have to do is provide the word trigger & the output. It can also contain several outputs. Check out xTalker v1.01.

 Respond  
Aucun50   -  Feb 28, 2010

All you did was add flood control then make it hard to read or edit using regex. No real need for regex here when the SIMPLE if statement does the job an can be edited or added by putting another if/elseif statement.

 Respond  
Jethro   -  Feb 28, 2010

I experiment with regex and regsubex to emulate your code the same way and has been a success:

on $*:text:/^(lol|rofl|brb|h(i|ello)|away|Im back)$/iS:#: {
  if (!%f) { inc -z %f 5 | .msg # 2,11 $nick $regsubex($1,/(.+)/iS,$iif($regml(1) = lol, is LAUGHING OUT LOUD,$&
      $iif($regml(1) = rofl, is ROLLING ON THE FLOOR LAUGHING,$iif($regml(1) = brb, will BE RIGHT BACK in a mooment,$&
      $iif($regml(1) = hi, Hello,$iif($regml(1) = hello, Hi,$iif($regml(1) = away,is currently AWAY and will be back in a moment,$&
    $iif($regml(1) = Im back, $nick is BACK from being away or BRB)))))))) }
}

Your script needs to have a trigger flood protection in case somebody spams 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.