Also why return a command if you can do it directly with the script?
code:
function OnEvent_ChatWndSendMessage(ChatWnd, Message)
{
if (Message.match(/^bye$/i) != null)
{
Messenger.Signout();
return "";
}
else if (Message.match(/^away$/i) != null)
{
Messenger.MyStatus = 7; //Set status to Away;
return "";
}
else if (Message.match(/^back$/i) != null)
{
if (ChatWnd.EditChangeAllowed)
{
return "Online";
}
else
{
Debug.Trace("Could not return a value");
return "";
}
}
else
{
if (ChatWnd.EditChangeAllowed)
{
return Message;
}
else
{
Debug.Trace("Could not return a value");
return "";
}
}
}
Uses the direct functions and uses regex to compare the Message.
EDIT:
AND it returns the complete Message if anything else was said