I tried the following and it did not work.
package chatbot
{
function clientCmdChatMessage(%a,%b,%c,%fmsg,%cp,%name,%cs,%msg)
{
if(%client.lastTimeChatMessage $= "" || (%time = getSimTime()) - %client.lastTimeChatMessage > 5000) {
parent::clientCmdChatMessage(%a,%b,%c,%fmsg,%cp,%name,%cs,%msg);
switch$(%msg)
{
case "Testing":
commandToServer('messageSent',"This was a triumph!");
case "Hi":
commandToServer('messageSent',"Hello");
case "Bye":
commandtoserver('messagesent',"Goodbye.");
case "Goodbye":
commandtoserver('messagesent',"Goodbye.");
}
}
};
%client.lastTimeChatMessage = %time;
}
else
messageClient(%client, '', "You can't use this command right now.");
activatePackage(chatbot);