Simple bot talker.

By Vesperia on Sep 26, 2009

This is just a simple talking script for bots. It's my first script posted on hawkee so be as harsh as possible. To use this script say the words: hi, sad, What's up, hello, nothing, and your bot's name.

on *:TEXT:hi:#: {
  /set %talk $rand(1,3)
  if (%talk == 1) msg $chan Hello $nick $+ , how are you today?
  if (%talk == 2) msg $chan What's up $nick $+ ?
  if (%talk == 3) msg $chan Wazzup $nick $+ ?
}
on *:TEXT:hello:#: {
  /set %talk $rand(1,3)
  if (%talk == 1) msg $chan Hello $nick $+ , how are you today?
  if (%talk == 2) msg $chan What's up $nick $+ ?
  if (%talk == 3) msg $chan Wazzup $nick $+ ?
}
on *:TEXT:What's up:#: {
  /set %talk $rand(1,3)
  if (%talk == 1) msg $chan What's up with you?
  if (%talk == 2) msg $chan Nothing but the sky, $nick $+ .
  if (%talk == 3) msg $chan You say what's up. I say what's down.
}
on *:TEXT:Nothing:#: {
  /set %talk $rand(1,2)
  if (%talk == 1) msg $chan If nothing's up then what are you talking about?
  if (%talk == 2) describe $chan slaps $nick "You're boring" :/
}
on *:TEXT:sad:#: {
  /set %talk $rand(1,4)
  if (%talk == 1) msg $chan Awwwww don't be sad $nick $+ .
  if (%talk == 2) describe $chan pats $nick on the back "Being sad makes you miss out on all of the good things in life."
  if (%talk == 3) msg $chan Be the opposite of sad and be glad! =D
  if (%talk == 4) msg $chan You're sad too much $nick $+ .
}
on *:TEXT:#:{
  if ($$2 == $me)
  /set %talk $rand(1,5)
  if (%talk == 1) msg $chan That's my name. Don't stick a knife through it.
  if (%talk == 2) msg $chan WHO SAID MY NAME?!?!?!
  if (%talk == 3) msg $chan Yes, $nick $+ .
  if (%talk == 4) describe $chan shoots $nick $+ , "DID I SAY YOU COULD SAY MY NAME?!"
  if (%talk == 5) msg $chan What can I help you with, $nick $+ ?
}

Comments

Sign in to comment.
Vegito   -  Aug 07, 2013
on *:TEXT:*:#:{
  if ($regex($1,/^(hi|hello)$/Si)) {
    msg # $gettok(Hello $nick $+ $chr(44) how are you today?|What's up $nick $+ ?|Wazzup $nick $+ ?,$r(1,1),124)
  }
  if ($1- = What's up) {
    msg # $gettok($v2 with you?|Nothing but the sky $+ $chr(44) $nick $+ |You say $lower($v2) $+ . I say what's down.,$r(1,3),124)
  }
  if ($1 = Nothing) {
    $gettok(msg # If $v2 $+ 's up then what are you talking about?|describe # slaps $nick $qt(You're boring) :/,$r(1,2),124)
  }
  if ($1 = sad) {
    $gettok(msg # Awwwww don't be $v2 $nick $+ .|describe # pats $nick on the back $qt(Being $v2 makes you miss out on all of the good things in life.) |msg # Be the opposite of $v2 and be glad! =D|msg # You're $v2 too much $nick $+ .,$r(1,4),124)
  }
  if ($2 = $me) {
    msg # $gettok(That's my name. Don't stick a knife through it.|WHO SAID MY NAME?!?!?!|Yes $+ $chr(44) $nick $+ ?|shoots $nick $+ $chr(44) $qt(DID I SAY YOU COULD SAY MY NAME?!) |What can I help you with $nick $+ ?,$r(1,5),124)
  }
}
 Respond  
Gage   -  Mar 29, 2010

o.o

 Respond  
sunslayer   -  Oct 06, 2009

Ok, your life expectancy tells me that you have a lot of years and time ahead of you to see it someday.Don't forget about the big cheese fart...

 Respond  
Jethro   -  Oct 06, 2009

Ok, your life expectancy tells me that you have a lot of years and time ahead of you to see it someday.

 Respond  
Vesperia   -  Oct 05, 2009

I'm just 14 and I don't watch much tv.....sad I know.

 Respond  
sunslayer   -  Oct 03, 2009

im only 15 and i know that show

 Respond  
Vesperia   -  Oct 03, 2009

I'm probably too young to know it.

 Respond  
Jethro   -  Oct 03, 2009

Well, too bad. I guess you never saw that TV show...lol

 Respond  
Vesperia   -  Oct 03, 2009

I may be the only one that has no idea what you're talking about. :P

 Respond  
Jethro   -  Oct 03, 2009

The first lesson in mirc scripting is patience, young grasshoppers. :P

 Respond  
sunslayer   -  Oct 02, 2009

epic movie, young grasshoppa!

 Respond  
Jethro   -  Oct 02, 2009

You two reminds me of a TV show called Kung Fu in the 70s, where it starred master Po and his apprentice whom he called grasshopper.

 Respond  
Vesperia   -  Oct 01, 2009

You are true about that Ghost-writer but I learned about vars on my own. :P

 Respond  
Ghost-writer   -  Sep 30, 2009

im the person who taught this guy to script :|

 Respond  
Jethro   -  Sep 29, 2009

Ghost-writer, don't be negatively cynical of other people's snippets. You should be supportive to offer your constructive criticism or positive suggestion, instead of disparaging people or being sarcastic toward them.

 Respond  
sunslayer   -  Sep 29, 2009

Ghost-writer we all started scripting by making snippets like this.

 Respond  
Ghost-writer   -  Sep 29, 2009

who ever rated above 5 is a failed scripter and should type //remove $mircdir right now.

 Respond  
Jethro   -  Sep 29, 2009

That is true. If you knew regex, you would be amazed how it could minimize the chances of mistaken words in a matching situation. Actually, I've provided an example using regex a few posts above. If you tried it, you'd know what I mean.

 Respond  
Vesperia   -  Sep 29, 2009

The reason I didn't is because whenever people said: "this" and "shine" it would activate.

 Respond  
Jethro   -  Sep 28, 2009

Why do you want to make it exclusively 'hi'? Why not: > on :TEXT:hi*:#: {

You have to say: hi. <- This won't even work, in your current code, for a period after the word hi

It's rare for people to just say the word hi without adding more words after it as a phrase. You should consider adding the wildcard strings for every one of your text event.

 Respond  
Vesperia   -  Sep 28, 2009

The problem is in the speech. It's only with the word by itself. It you say something like this: hi Vesperia. It won't respond. You have to say: hi.

 Respond  
Gage   -  Sep 28, 2009

It doesn't work for me for my bot some reason..

 Respond  
Jethro   -  Sep 28, 2009

First of all, Ghost-writer, you were the one who made a suggestion using if $me isin $1-

second, that is one way to go at randomizing messages. I was basically basing my suggestion off the author's script as close as possible.

Finally, for your info, you can also use the /play command with the -r switch:

on *:TEXT:$($+(*,$me,*)):#: { .play -r # bla.txt }

The -r switch forces a single line to be chosen randomly from a file and played. One thing about using /play command is that it provides a default of 1000ms delay per trigger, unless changed otherwise.

P.S. My suggestion was pretty decent.

 Respond  
Ghost-writer   -  Sep 28, 2009

jethro if your gonna make a suggestion make a good one :\ tell him to use a $read(bla.txt) then write bla.txt response. less lines, possibley even one :O,

on :TEXT: $+ $me $+ *:#: { msg # $read(bla.txt) }

 Respond  
Jethro   -  Sep 27, 2009
on *:TEXT:$($+(*,$me,*)):#: { 
  var %talk = $rand(1,5)
  if (%talk == 1) {
    msg # That's my name. Don't stick a knife through it.
  }
  if (%talk == 2) {
    msg $chan WHO SAID MY NAME?!?!?!
  }
  if (%talk == 3) {
    msg $chan Yes, $nick $+ .
  }
  if (%talk == 4) {
    describe $chan shoots $nick $+ , "DID I SAY YOU COULD SAY MY NAME?!"
  }
  if (%talk == 5) {
    msg $chan What can I help you with, $nick $+ ?
  }
}
 Respond  
Vesperia   -  Sep 27, 2009

Yeah I see the problems. But I honestly didn't know any way of fixing them and you weren't on PurpleSurge.

 Respond  
Ghost-writer   -  Sep 27, 2009

on :TEXT::#:{ <--- check that.
if ($me isin $1-) <--- check that
var %talk $rand(1,5) <--- check that
if (%talk == 1) msg # That's my name. Don't stick a knife through it. <-- check that
if (%talk == 2) msg $chan WHO SAID MY NAME?!?!?!
if (%talk == 3) msg $chan Yes, $nick $+ .
if (%talk == 4) describe $chan shoots $nick $+ , "DID I SAY YOU COULD SAY MY NAME?!"
if (%talk == 5) msg $chan What can I help you with, $nick $+ ?
}
lots of tiny bugs you could just fix.

 Respond  
Jethro   -  Sep 26, 2009
  1. You don't need multiple text events per trigger.
  2. You don't need to use the global variables; the local ones will do.
on $*:TEXT:$(/((h)i|ello|what's up|nothing|sad| $+ $me $+ )$/iS):#: {
  var %hi = Hi $nick $+ , how are you today?|What's up $nick $+ ?|Wazzup $nick $+ ?
  var %whatsup = What's up with you?|Nothing but the sky, $nick $+ .|You say what's up. I say what's down.
  if ($regml(1) == hi) || ($regml(1) == ello) {
    msg # $gettok(%hi,$r(1,$numtok(%hi,124)),124) 
  }
  if ($regml(1) == what's up) {
    msg # $gettok(%whatsup,$r(1,$numtok(%whatsup,124)),124) 
  }
  if ($regml(1) == nothing) {
    var %nothing = $r(1,2)
    if (%nothing == 1) msg # If nothing's up then what are you talking about?
    if (%nothing == 2) describe # slaps $nick "You're boring" :/
  }
  if ($regml(1) == sad) { 
    var %sad = $r(1,4)
    if (%sad == 1) msg # Awwwww don't be sad $nick $+ .
    if (%sad == 2) describe # pats $nick on the back "Being sad makes you miss out on all of the good things in life."
    if (%sad == 3) msg # Be the opposite of sad and be glad! =D
    if (%sad == 4) msg # You're sad too much $nick $+ .
  }
  if ($regml(1) == $me) {
    var %me = $r(1,5)
    if (%me == 1) msg # That's my name. Don't stick a knife through it.
    if (%me == 2) msg # WHO SAID MY NAME?!?!?!
    if (%me == 3) msg # Yes, $nick $+ .
    if (%me == 4) describe # shoots $nick $+ , "DID I SAY YOU COULD SAY MY NAME?!"
    if (%me == 5) msg # What can I help you with, $nick $+ ?
  }
}

$r() is the same as $rand()

 Respond  
Vesperia   -  Sep 26, 2009

I know this is just something I made out of boredom.

 Respond  
VinX   -  Sep 26, 2009

the pandora bot is the best talker ..

 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.