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 $+ ?
}
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)
}
}
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...
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.
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.
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 $+ ?
}
}
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.
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()