function OnEvent_ChatWndSendMessage(pChatWnd, sMessage) {
oChats[pChatWnd.Handle] = sMessage;
}
function OnEvent_ChatWndDestroyed(pChatWnd) {
delete oChats[pChatWnd.Handle];
}
function OnEvent_ChatWndReceiveMessage(pChatWnd, sOrigin, sMessage, nKind) {
if (typeof oChats[pChatWnd.Handle] === 'object'
&& oChats[pChatWnd.Handle] === sMessage) {
// we sent the message
delete oChats[pChatWnd.Handle];
} else {
if (!pChatWnd.EditChangeAllowed) return sMessage; // we cannot send a message for whatever reason
switch (sMessage) {
case '!server':
pChatWnd.SendMessage('');
break;
case '!site':
pChatWnd.SendMessage('');
break;
}
}
}
This post was edited on 08-02-2010 at 05:50 PM by matty.