It really depends on how advanced you want it. A very, very basic chatbot can be done with something simple like this:
function parseChat(%cl, %message)
{
%name = %cl.name;
switch$(getWord(%message,0))
{
case "Hello":
return "Hello, " @ %name @ ".";
case "Say":
return getWords(%message,1);
case "Bye":
return "Bye, " @ %name @ ".";
}
}
Then just feed it through a package like this:
package chatBot {
function serverCmdMessageSent(%client, %msg)
{
parent::serverCmdMessageSent(%client, %msg);
if(getWord(%msg,0) $= "Bot")
botSay(parseChat(%client, %msg));
}
};
function botSay(%msg)
{
announce("Bot\c6:" SPC %msg);
}