Post the whole script.
package chatbot
{
function clientCmdChatMessage(%a,%b,%c,%fmsg,%cp,%name,%cs,%msg)
{
parent::clientCmdChatMessage(%a,%b,%c,%fmsg,%cp,%name,%cs,%msg);
if(%msg $= "MB>Index"){
commandToServer('messageSent',"MagicBot: Commands, Rules, News");
}
if(%msg $= "MB>Commands"){
commandToServer('messageSent',"MagicBot: MBAnno:restwords");
}
if(firstWord(%msg) $= "MBAnno:"){
commandToServer('messageSent',"MagicBot: "@restWords(%msg));
}
}
};
activatepackage(chatbot);