Hi,
I am experiencing a problem with a new way of parsing commands.
The following code displays an error about invalid commands:
code:
function OnEvent_ChatWndSendMessage(pChatWnd,sMessage) {
if(Initialised) {
isCommand = parseCommands(pChatWnd,sMessage.toLowerCase());
if(isCommand) {
return "";
}
return sMessage;
}
}
function parseCommands(objChatWnd,strMessage) {
if(strMessage.substr(1,12) == "skincreator" && strMessage.charAt(0) == "/") {
Splitter = sterMessage.split(" ");
FunctionName = Splitter[1];
if(FunctionName == "openskin") {
Skin.Name = strMessage.substr(21);
BrowseFile(Skin.Dir + "\\" + Skin.Name,"xml");
}
return true;
} else {
return false;
}
}
To make things worse, nothing shows up in the debugger.
Does anyone know what's wrong with this code?
Tnx in advance.