As promised this is a tutorial for building a Flash interface for a Pandorabots chatbot.
This is a portion of an unreleased game I was building where you are stuck inside of a giant maze. The maze is actually a machine. An artificial intelligence called “I”.
You can talk to it throughout your journey, and it engages with you in existential conversations, often taunting you. You can check out some screenshots, and more of that here.
It was intended to be part of BlueSuburbia. At present it’s slipped to the back burner.
The source files that are given with this tutorial are a completely built, fully done up, interface of the above… Preloaders, animations, and all.
I’ve simplified it, and the workings of it should be pretty self-explanatory.
It should suffice in starting you out on your bot mastering, programing, and creating adventures! :D
I have an extensive, and more informative, tutorial on setting up a Program E (php) bot here.
It is a lot more concise. I strongly recommend visiting that page as well.
It features a very thorough introduction into the world of chatbots. CLICK HERE.
You will need to start an account with Pandorabots.
Create your bot starting either from scratch, or with an already available AIML set.
I prefer to use The Annotated A.L.I.C.E. AIML available here.
They are the simplest, and cleanest to start with.
After that is done go to the “My Pandorabots” page, then click on your bot’s name.
It will give you the URL where your bot is published at. Copy and paste the botid (the numbers after
"botid="). You’ll need that later in the Flash code end.
Basically, all that is necessary in the Flash-end are two text fields.
One set to DYNAMIC text for the bot’s responses, called:
One set to INPUT for the user’s input, called:
Everything else here is purely decorative treatment.
Following is the send/receive code.
Comments explaining what’s what are in-line:
The code for “writing out” the bot’s reply is as follows…
Update: An even better version of the above “writeText”…
And that’s all that’s needed! Simple and sweet.
Here’s the end result (you’ll have to turn him on first!) :
[swfobj src=”http://nathalielawhead.com/sourcefiles/Pandorabots_Flash/pandorabots_I_AS3.swf” height=”500″ width=”800″]
Talk to him! Click here for fullscreen.