First, it would be a lot easier to have the switch nested inside the activate check, instead of having a whole bunch of activate checks.
Secondly, as said in the Scripting Docs (
here), the ChatWndReceiveMessage event is triggered whenever anything is added to the history box in a chat window which includes messages sent by yourself. As such you must compare the Origin parameter to your current nickname to check that it was not you who sent the message before making any responses.
code:
function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message1, MessageKind)
{
if (activate == 1 && Origin != Messenger.MyName) {
switch(Message1)
{
case "brb":
ChatWnd.SendMessage('okey dokey');
break;
case "bye":
ChatWnd.SendMessage('ok if u dont get lost soon i will kill you '+ Origin);
ChatWnd.SendMessage('jk jk');
break;
}
}
}
NOTE: A known limitation is that if a user uses the exact same nickname as yourself they will be recognised as you, and as such will not be responded to by the script.