Lights On, Nobody Home

Yur Bot Can Spel Betern U

(Okay, this is beyond what the BotBot can handle for now)

The most famous type of chat bots are, well, chatterbots. Eliza, Julia, and Newt in the outside world. Ratbot and Harry in the Palace world. A chatterbot pretends it's somebody it listens, it watches, and it talks.

Who needs artificial intelligence,
when you can have an artificial personality?

There are three ways to trigger a chatterbot into doing something, and one of them is cheating.

  1. Have it respond to something someone said, via the ON INCHAT handler.
  2. Put it on a (possibly random) timer, so that if no one talks to it, it will eventually start talking on its own.
  3. You tell it to talk via an OUTCHAT command. But that's cheating, you're telling it what to do. A real chatterbot should be allowed to make a fool of itself (and you, by extension) autonomously.
  4. I may be mistaken, but I think that Ratbot uses a fourth method, unavailable to mere mortals: it responds to whispered messages sent to it by the Wheel of Cheese room. That way, the room can catch events like ON ENTER which Ratbot wouldn't normally be able to trap.
Of course, in a crowded room, the bot needs to know who's talking, and especially if they're talking to the bot. So it's common to see the beginning of each INCHAT event setting a host of flags, trying to figure out what's what.

    CHATSTR LOWERCASE		lowchat	=
    WHOCHAT WHOME == NOT	notMe	=
    WHOCHAT WHONAME		whom	=
; identify Guests, filter the word "Guest" off speaker's name
    0				isG	=
    {
	"$1" GREPSUB		whom	=
	{
	    [
		"Tennis Ball "
		"BubbleHead "
		"Nonmember "
		"Freeloader "
		"Guest "
	    ] 5 RANDOM GET whom & whom	=
	} 10 RANDOM 4 == IF
	1			isG =
    } WHOCHAT WHONAME "Guest ([0-9]*)" GREPSTR IF
; You Talkin' to Me?
    lowchat " doc,*\.*,*X"	GREPSTR
    lowchat " dr\.*$"		GREPSTR OR
    lowchat " [xz][ei]nu,*\.*"  GREPSTR OR
    lowchat " x[.!]*$"		GREPSTR OR
    lowchat "^x[.!]*$"		GREPSTR OR
    lowchat " dr[aeiou]"	GREPSTR NOT AND	aboutMe	=
; You sayin Hello?
    lowchat "hello,*"		GREPSTR
    lowchat "hi,* "		GREPSTR OR
    lowchat "hiya,* "		GREPSTR OR
    lowchat "^hey,* "		GREPSTR OR
    lowchat "greetings,* "	GREPSTR OR
    lowchat "howdy,* "		GREPSTR OR
    lowchat "hello *$"		GREPSTR OR
    lowchat "^hi *$"		GREPSTR OR
    lowchat "greetings *$"	GREPSTR OR
    lowchat "howdy *$"		GREPSTR OR
    lowchat "hola *$"		GREPSTR OR	isGreet =
; Or Goodbye?
    lowchat "bye"		SUBSTR
    lowchat "adios"		SUBSTR OR
    lowchat "^later,* "		GREPSTR OR
    lowchat "^nite,* "		GREPSTR OR
    lowchat "^night,* "		GREPSTR OR
    lowchat "good *nite"	GREPSTR OR
    lowchat "good *night"	GREPSTR OR	isAdios =

These strings and toggles lay down the shape of all chatterbot code to come. Is the person speaking not me? Are they a guest? Are they addressing me? Is it a greeting? A goodbye? These patterns have been arrived at through trial and (mostly) error. They work for me, usually.
By grabbing at a few basic straws in this way, we can come up with what might be appropriate responses for bot.X....

    {
	{
	    "Hi there, " whom & SAY
	} isGreet IF
	{
	    "CU later, " whom & WHOCHAT PRIVATEMSG
	} isAdios IF
    } notMe isG NOT AND IF

This bot is set up to ignore all Guests you may want to do just the opposite, letting the bot greet all guests, but allowing you (the wetware part, remember?) to completely ignore (mute) anything and everything that any guest might say. Like this:

    {
	{
	    "Hi there, " whom & SAY
	} isGreet aboutMe AND IF
	{
	    "CU later, " whom & WHOCHAT PRIVATEMSG
	} isAdios IF
	"" CHATSTR =
    } isG IF

To add personality to the bot, one of the simplest methods is to give it an assortment of roughly equivalent phrases to use, instead of the simple "Hi there, ...." Consider this possible replacement for the greetings line above

    [
	"Hello |"
	"Hoy |"
	"'lo |"
	"Hello, |"
	"Hail |"
	"Howdy |"
	"@64,64 !It's |!"
	"Howzit, |?"
	"Hello"
	":Hmm, | returns"
	"Yo |"
	"|, my droogie."
	"Long Time No Viddy, |"
	"Evening, |"
	"|"
	"| wa - do genki?"
	"Happy happy, |"
	"|!!"
	"Greetings, |"
    ] 19 RANDOM GET				greetResp =
    {
	"$1" GREPSUB whom & "$2" GREPSUB &	greetResp =
    } greetResp "(.*)|(.*)" GREPSTR IF
    greetResp SAY

Autonomous palace bots are a process of experimentation like no other. Unlike a "regular" program, you can't control the input! Surprises can come at every corner I once had an auto-greeting bot that started greeting someone else's auto-greeting bot which in turn greeted my bot, which in turn greeted the other bot again.... until one of the bots finally said something that the other didn't recognize, about 30 greetings later.

At this point (!) it's useful to think about our seemingly-innocent changes to the "finger" script. Among other things, it automatically return-fingers the person who fingered it. Now... what if they, too, are running an auto-return "finger"? The two bots will finger each other ad infinitum....
The obvious shortcut solution to this problem is to never let it auto-finger the same user twice in a row, which means keeping track of the WHOCHAT value and stashing it in yet another GLOBAL variable, which is indeed what the BotBot version does.
Whatever you do with your bot scripts, try to be sure you have a way to turn it off, short of disconnecting. Of course, the server might kill you for flooding anyway....
Using a bot as a replacement for yourself raises all sorts of ethical and philosophical issues about mind and identity that we really don't have time for anyway. In the short run, mark your bot as a bot. Change the name, preferably to something with the letters "bot" in it, or have the bot put on a special prop when it's speaking (the original XBot had lights in its eyes that came on whenever it spoke).
Be very wary of empowering foolish robots. I once empowered an XBot robot to kill other users and it promptly did so, the first time my back was turned. While it did kill some users for obscene attacks, it also killed some other who were merely curious and were trying to provoke the robot to "do something interesting."
I've recently started using female avatars for my bots, rather than male or androgynous ones. It may be my imagination, but people do seem to be a lot nicer to a feminine robot...

More to Come Under Construction