What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Two questions[Edit: Three, check page 2]

Two questions[Edit: Three, check page 2]
Author: Message:
TechedRonan
New Member
*

Avatar
Duja

Posts: 12
Joined: Jul 2006
O.P. RE: Two questions
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;
          }
     }
}
}

07-23-2006 03:13 AM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Two questions[Edit: Three, check page 2] - by TechedRonan on 07-22-2006 at 11:42 AM
RE: Two questions - by TechedRonan on 07-23-2006 at 02:45 AM
RE: Two questions - by Silentdragon on 07-23-2006 at 02:51 AM
RE: Two questions - by cooldude_i06 on 07-23-2006 at 02:54 AM
RE: Two questions - by markee on 07-23-2006 at 03:00 AM
RE: Two questions - by TechedRonan on 07-23-2006 at 03:13 AM
RE: Two questions - by markee on 07-23-2006 at 03:17 AM
RE: Two questions - by Silentdragon on 07-23-2006 at 03:18 AM
RE: Two questions - by cooldude_i06 on 07-23-2006 at 03:20 AM
RE: Two questions - by TechedRonan on 07-23-2006 at 03:21 AM
RE: Two questions - by cooldude_i06 on 07-23-2006 at 03:22 AM
RE: Two questions - by TechedRonan on 07-23-2006 at 03:29 AM
RE: Two questions[Edit: Three, check page 2] - by TechedRonan on 07-23-2006 at 02:53 PM
RE: Two questions[Edit: Three, check page 2] - by -dt- on 07-23-2006 at 04:02 PM
RE: Two questions[Edit: Three, check page 2] - by cloudhunter on 07-23-2006 at 06:34 PM
RE: Two questions[Edit: Three, check page 2] - by TechedRonan on 07-23-2006 at 07:02 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On