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]

Pages: (2): « First [ 1 ] 2 » Last »
Two questions[Edit: Three, check page 2]
Author: Message:
TechedRonan
New Member
*

Avatar
Duja

Posts: 12
Joined: Jul 2006
O.P. Two questions[Edit: Three, check page 2]
quote:
Originally posted by TechedRonan
Yeah noticed after the post :P
I made two edits, didn't notice page two.

heres edit2
quote:
Originally posted by TechedRonan
Edit2: Could someone please show the actual part that sends the xml to the server? Status2FTP is a bit confusing for me, sadly.


From page two.

This post was edited on 07-23-2006 at 02:54 PM by TechedRonan.
07-22-2006 11:42 AM
Profile E-Mail PM Find Quote Report
TechedRonan
New Member
*

Avatar
Duja

Posts: 12
Joined: Jul 2006
O.P. RE: Two questions
Bump, no one answers.
07-23-2006 02:45 AM
Profile E-Mail PM Find Quote Report
Silentdragon
Full Member
***

Avatar
if(life==null && wrists) EmoAlert();

Posts: 148
Reputation: 2
34 / Male / –
Joined: Jun 2006
RE: Two questions
For the xml question go look at the status2ftp script for ftp functions.

As for arrays, you're comparing a string to an entire array, of course it won't work. Create a loop to run through the entire array. But in your example if(Message.match(/Duja/i) != 0) would be better.

This post was edited on 07-23-2006 at 02:51 AM by Silentdragon.
07-23-2006 02:51 AM
Profile E-Mail PM Web Find Quote Report
cooldude_i06
Full Member
***

Avatar
I'm so cool I worry myself.

Posts: 272
Reputation: 9
– / Male / –
Joined: Sep 2003
RE: Two questions
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 post was edited on 07-23-2006 at 02:56 AM by cooldude_i06.
[Image: clb2.jpg]
07-23-2006 02:54 AM
Profile E-Mail PM Web Find Quote Report
markee
Veteran Member
*****

Avatar

Posts: 1622
Reputation: 50
36 / Male / Flag
Joined: Jan 2006
RE: Two questions
The variabe Message is a string and not an array, to fix this you can use a 'for' to list through the different lines in the array.  Maybe have a look at the JScript documentation from microsoft (MSDN)

I'm not sure about the first question though sorry.

EDIT: Looks like I was beaten to it, but the MSDN will still help you with further scripting and problems like this.

This post was edited on 07-23-2006 at 03:01 AM by markee.
[Image: markee.png]
07-23-2006 03:00 AM
Profile PM Find Quote Report
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
markee
Veteran Member
*****

Avatar

Posts: 1622
Reputation: 50
36 / Male / Flag
Joined: Jan 2006
RE: Two questions
Try this instead
code:
function OnEvent_ChatWndReciveMessage(ChatWnd, Origin, Message, MessageKind){
if(Origin == Messenger.MyName){return;}
else{
     for(i=0;i<2;i++){
         if(LIST[i] == Message){
               ChatWnd.SendMessage("Duja");
               Debug.Trace("Duja detected");
               break;
          }
     }
}
}

This should work for you now, just had to fix the 'for' line
[Image: markee.png]
07-23-2006 03:17 AM
Profile PM Find Quote Report
Silentdragon
Full Member
***

Avatar
if(life==null && wrists) EmoAlert();

Posts: 148
Reputation: 2
34 / Male / –
Joined: Jun 2006
RE: Two questions
for(var i = 0; i < LIST.length; i++)

would be better allows easier managing of changing array sizes.
07-23-2006 03:18 AM
Profile E-Mail PM Web Find Quote Report
cooldude_i06
Full Member
***

Avatar
I'm so cool I worry myself.

Posts: 272
Reputation: 9
– / Male / –
Joined: Sep 2003
RE: Two questions
"Recive" is spelt wrong, it should be "Receive" as in
code:
OnEvent_ChatWndReceiveMessage
.

Markee - there was nothing wrong with the for line

This post was edited on 07-23-2006 at 03:21 AM by cooldude_i06.
[Image: clb2.jpg]
07-23-2006 03:20 AM
Profile E-Mail PM Web Find Quote Report
TechedRonan
New Member
*

Avatar
Duja

Posts: 12
Joined: Jul 2006
O.P. RE: Two questions
Still doesn't work. Not sure but could it perhaps be because i'm using 2 accounts(multimsn feat) to test it? (I would just guess it would spam me a bit, or create an infinate loop and crash msn)

EDIT: Oh.. doh.
Yeah it works now, thanks for the help all!

Edit2: Could someone please show the actual part that sends the xml to the server? Status2FTP is a bit confusing for me, sadly.

This post was edited on 07-23-2006 at 03:26 AM by TechedRonan.
07-23-2006 03:21 AM
Profile E-Mail PM Find Quote Report
Pages: (2): « First [ 1 ] 2 » Last »
« Next Oldest Return to Top Next Newest »


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