quote:
Originally posted by cooldude_i06
quote:
Originally posted by TechedRonan
code:
var LIST = new Array();
LIST[0]="Duja";
LIST[1]="duja";
function OnEvent_ChatWndReciveMessage(ChatWnd, Origin, Message, MessageKind){
if(Origin == Messenger.MyName){return;}
else if(Message == LIST){
ChatWnd.SendMessage("Duja");
Debug.Trace("Duja detected");
}
}
You cannot compare the array's object itself to a string. You need to loop through the array and compare against each element.
code:
else{
for(i in LIST){
if(LIST[i] == Message){
ChatWnd.SendMessage("Duja");
Debug.Trace("Duja detected");
break;
}
}
}
This is what i ended up with and it doesn't work:
code:
function OnEvent_ChatWndReciveMessage(ChatWnd, Origin, Message, MessageKind){
if(Origin == Messenger.MyName){return;}
else{
for(i in LIST){
if(LIST[i] == Message){
ChatWnd.SendMessage("Duja");
Debug.Trace("Duja detected");
break;
}
}
}
}