matty
Scripting Guru
Posts: 8336 Reputation: 109
39 / /
Joined: Dec 2002
Status: Away
|
RE: /commands
js code: function OnEvent_ChatWndSendMessage(oChatWnd, sMessage){
if (/^\/([^\s\/]+)\s*([\s\S]*)$/.exec(sMessage) !== null) {
var _command = RegExp.$1.toLowerCase();
var _param = RegExp.$2;
switch (_command) {
case 'test':
// do something here
break;
case 'test1':
// do something here
break;
}
}
return sMessage;
}
|
|