Thursday 8 October 2009

Educational tools in SL

I've just finished compiling a list of educational tools available in Second Life. You can view the Google Doc here:

http://docs.google.com/Doc?docid=0AbJhUXLbxPT9ZGY0NDNwM3pfNmhwbTVxZGMy&hl=en

Friday 2 October 2009

AIMLBot and Open Metaverse

To remove any hard work in creating a chat bot using Open Metaverse, I performed a search for C# AIML parsers. Top of the list was AIMLBot (http://aimlbot.sourceforge.net/), and after a bit of poking around they seem to work well together.


There was some head scratching because the chat example on the Open Metaverse page (http://lib.openmetaverse.org/wiki/Respond_to_inworld_chat) seems to be out of date - the LL prefix from LLUUID and LLVector3 seem to have been dropped. The AIMLBot also doesn't come with the xml and aiml files needed, but I just took those from Radegast.

As it stands the chat call back is fired whenever anyone starts typing nearby, and when it hears itself. My slap-dash solution is included below:


static void Self_OnChat(string message, ChatAudibleLevel audible,
ChatType type, ChatSourceType sourceType, string fromName,
UUID id, UUID ownerid, Vector3 position)
{
if (message != "")
{
if (fromName != "Test Bot")
{
//process chat here
AIMLbot.Request request = new AIMLbot.Request(message,
myUser, myBot);
AIMLbot.Result reply = myBot.Chat(request);

Client.Self.Chat(reply.Output, 0, ChatType.Normal);
Console.WriteLine(reply.Output);
}
}
}


That's the main component of the chat bot, so you can see that it is very easy to implement.