Showing posts with label chatbot. Show all posts
Showing posts with label chatbot. Show all posts

Wednesday, September 28, 2011

The ChatBot MegaHAL Ported to Flash


Also: Have a Talk with MegaHAL on Kongregate.

When I first created a simple Chatbot, which just searches answers for user inputs from a predefined XML file, someone pointed me to MegaHAL as an example which can be trained from users' inputs.
MegaHAL is an advanced ChatBot, created by Jason Hutchens in 1998 and won the Loebner Prize Contest. MegaHAL is based on 4th-order Markov models to construct the model of language, so it can learn from user's input. Thanks to Adobe Alchemy, porting MegaHAL is almost painless.

[1 HOW TO PLAY]
Click after the prompt ">" to get focus. Then type what you want to say after the prompt and press Enter key twice to sent your message to the Bot. Now you can get your reply. (The interface is command-like)
[Save the brains]: "right click" =>"#Save brain"
[Upload your brains]: "right click" =>"#Upload brain"=>browse for your save brain, it's a zip file=> type command "#brain user" to change the brain

[2 CHANGING PERSONALITIES]
Use MEGAHAL COMMAND “#brain YourBrainName”
{
Available Brains:
#brain aliens (Bishop from Aliens!)
#brain bill (Bill Clinton)
#brain caitsith (Cait Sith from FFVII)
#brain danish (Danish MegaHAL).
#brain dune (Alia from Dune!)
#brain ferris (Mr. Ferris Bueller himself!)
#brain german (German MegaHAL)
#brain manson (MegaMANSON, the Marylin Manson personality) #brain pulp (Marsellus Wallace from Pulp Fiction!)
#brain scream (Randy from Scream!)
#brain startrek (Data from Star Trek)
#brain starwars (Threepio from the Star Wars Trilogy)
}

I also created a forum for Flash MegaHAL, so you can upload and share your trained brains there:
http://flaswf.freeforums.org/flash-megahal-f25.html

Source Code of Flash MegaHAL:
In Game->Right Click->Download Source Code

MegaHAL Official Website:
http://megahal.alioth.debian.org/

To know more about one of the best ChatBots MegaHal:
http://en.wikipedia.org/wiki/MegaHAL

Saturday, August 30, 2008

My chatbot in Flash

flash as3.0 聊天机器人(点击展开中文翻译)

I was inspired by an interesting chatbot flash made by Chad Adams.
I can't fully understand his original class in flash mx, so just write one myself.
It costs me some time because I have to write the code while searching and learning what I need about XML.
I am not good at using action script to deal with XML and strings.
So no doubt the class can be improved.

Don't laugh at my bot, after all its brain only weighs 2 KB!
My chatbot source is Here: flash_chatbot_v1.0.rar
Chad Adams's original code is available at http://www.flashcomponents.net/component/flash_chat_bot.html
All in all, this is one simple experiment. All it can do is to search the XML data (by Chad) to find answers according to some word you typed in and display the answers.

To extend my chatbot and make it more "clever", you can replace "brain.xml" with more complicated things such as "Artificial Intelligence Markup Language" and try to parser them:
http://en.wikipedia.org/wiki/AIML
http://www.alicebot.org/aiml.html
and some open source chatbots based on AIML:
http://sourceforge.net/projects/programe/(AIML chatterbot written in PHP and using MySQL.)
http://www.smart-page.net/blog/2009/10/16/flash-aiml-tts-chatbot-hal9000-using-php-and-festival/ (Flash AIML TTS Chatbot – ‘HAL9000′ using PHP and Festival)

By the way, if you are interested in chatbot, here are some links:
Some powerful chatbots are
Adam:http://www.dudziak.com/talk.cgi
Alice:http://alice.pandorabots.com/
MegaHAL: http://megahal.alioth.debian.org/
they can say more and answer more questions.

Jamie Durrant offers us a tutorial about how to write a chatbot using what ALICE (above) knows(as2.0 or lower) with code here: http://www.jamiedurrant.com/flashbot.html .
What that flash file do is to replace the default html interface when using the AI chatbot at www.pandorabots.com.
Another Actionscript 3 Pandorabot Chat Class is here:
http://alicebot.blogspot.com/2008/05/pandorabots-has-xml-rpc-interface-that.html

Finally, some flash chatbots:
Crunchy: http://portfoliosites.com.au/billtest/chat/
by Billy T (nice UI !).
Square-bear: http://www.square-bear.co.uk/games/bearbot/chat.htm
by Steve Worswick.

Sponsors