You need to add two functions to your script.
code:
function OnGetScriptCommands()
{
var s = "<ScriptCommands>";
s += "<Command>";
s += "<Name>!!COMMAND NAME HERE!!</Name>";
s += "<Description>!!COMMAND DESC. HERE!!</Description>";
s += "</Command>";
s += "</ScriptCommands>";
return s;
}
code:
function OnEvent_ChatWndSendMessage(ChatWnd, strMessage)
{
if (strMessage.charAt(0) != '/') return strMessage;
var arrMessage = strMessage.split(' ');
var strCommand = arrMessage[0];
switch(strCommand){
case "/!!COMMAND NAME HERE!!":
!!DO COMMAND STUFF HERE!!
return "";
default:
return strMessage;
}
}
The parts which you will need to edit I have highlighted with "!!".
Good Luck
,
David