Fybertech Forums

Projects and Development => Fybertech Projects => Topic started by: Armchair on January 08, 2007, 07:24:25 pm

Title: Chatbot
Post by: Armchair on January 08, 2007, 07:24:25 pm
So yeah, I made a little bot with some aid from Fyber. Here's the list of phrases that he responds to.

Sup Metbot
Say Good Night Metbot
Metbot, up top
/mehigh fives Metbot
Metbot, Where live?
I love you Metbot
Why hate good boy me Metbot
METBOT KILL
Metbot, Time
Metbot what time is it?
Seriously, Metbot, what time is it?
Good boy Metbot
Bad boy Metbot
Metbot, who are you?
Are you a bot?
Metbot, are you real?


Guess what Kakarot?
IT'S OVER NINE THOUSAAAAND
Title: Re: Chatbot
Post by: FyberOptic on January 08, 2007, 07:32:32 pm
Here's a tip on how to be a bit more lenient on how he responds, instead of depending on particular phrases.

on *:TEXT:*:#: {
  if ($pos($1-,metbot,0) > 0 && $pos($1-,time,0) > 0) msg $chan It's $asctime(hh:nntt) $+ , dummy.
}

This one will let him respond to anything with the word "metbot" and "time" in it, in any order.

Keep in mind, if you use "on *:TEXT:*:#:", you can only have one of these remotes.  That means you'll have to do all your matching inside of this same remote.  So to add in another command, just add below the last IF check:

on *:TEXT:*:#: {
  if ($pos($1-,metbot,0) > 0 && $pos($1-,time,0) > 0) msg $chan It's $asctime(hh:nntt) $+ , dummy.
  if ($pos($1-,Guess what Kakarot?,0) > 0) msg $chan IT'S OVER NINE THOUSAAAAND
}




To anyone else who wants Metbot's responses to gray out like Fyborg's do, assuming you use the script I made recently, here's an updated version which works on both bots:

on ^*:TEXT:*:#: {
  if ($nick == Fyborg || $nick == Metbot) { echo 15 -ti2 $chan $chr($asc([)) $+ $nick $+ ] $1- | halt }
}

It should appear fairly simple to edit, but if you need to add more to it and don't know how, just ask.

Title: Re: Chatbot
Post by: FyberOptic on January 09, 2007, 08:01:33 pm
Also here's a possible update for your METBOT KILL trigger:

if ($strip($1-2) == METBOT KILL) { msg $chan RRRRRAAAARRARRRRARRAR | if ($len($3) > 0) describe $chan tackles $3 }

Put that inside your main "on *:TEXT:*:#:" handler.  You'll have to add your color/bold back in though since that doesn't paste good here.

So if someone says "METBOT KILL", it'll still do its RARRR like always.   Though if they add a name after it, like "METBOT KILL FYBORG", it'll RARRR first, then do an action to tackle them.

For reference, $strip removes the color codes from whatever you put inside, that way it won't interfere with detecting what words they said.  $1-2 means to check words 1 through 2 of what they said to match against.  $3 is the third word they used, which in the case of a METBOT KILL command, would be the person they wanted to kill.  $len checks the length of this, which in this case is being done to see if they actually typed in a name.

Whenever you're using multiple commands in response to an IF or an ON TEXT type thing, use the { } brackets.  Separate your commands with a | (the pipe symbol, on the backslash key).