matty
Scripting Guru
Posts: 8336 Reputation: 109
39 / /
Joined: Dec 2002
Status: Away
|
RE: find out exact text of someone's message.. (something like that)
Your code is wrong...
code: var link1 = "No link set";
var link2 = "No link set";
var link3 = "No link set";
function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MessageKind) {
if(Origin != Messenger.MyName) {
if (sMessage.charAt(0) == '!') {
if(sMessage.charAt(1) == '!') return sMessage;
else var parts is sMessage.split(" ");
}
if (parts[0] == "!set") {
switch (parts[1]) {
case 'link1' :
link1 = parts[2];
return "Link1 set to "+link1;
case 'link2':
link2 = parts[2];
return "Link2 set to "+link2;
case 'link3':
link3 = parts[2];
return "Link3 set to "+link2;
}
else if (parts[0] == "!link1") ChatWnd.SendMessage(link1);
else if (parts[0] == "!link2") ChatWnd.SendMessage(link2);
else if (parts[0] == "!link3") ChatWnd.SendMessage(link3);
}
}
}
Note: this in no way has been optimized. This should not be taken as a reflection of my programming abilities... just my laziness.
|
|