matty
Scripting Guru
Posts: 8336 Reputation: 109
39 / /
Joined: Dec 2002
Status: Away
|
RE: Command parser not working
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;
}
}
|
|