Two questions[Edit: Three, check page 2] - Printable Version
-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: Two questions[Edit: Three, check page 2] (/showthread.php?tid=63781)
Two questions[Edit: Three, check page 2] by TechedRonan on 07-22-2006 at 11:42 AM
quote: Originally posted by TechedRonan
Yeah noticed after the post
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.
RE: Two questions by TechedRonan on 07-23-2006 at 02:45 AM
Bump, no one answers.
RE: Two questions by Silentdragon on 07-23-2006 at 02:51 AM
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.
RE: Two questions by cooldude_i06 on 07-23-2006 at 02:54 AM
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;
}
}
}
RE: Two questions by markee on 07-23-2006 at 03:00 AM
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.
RE: Two questions by TechedRonan on 07-23-2006 at 03:13 AM
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;
}
}
}
}
RE: Two questions by markee on 07-23-2006 at 03:17 AM
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
RE: Two questions by Silentdragon on 07-23-2006 at 03:18 AM
for(var i = 0; i < LIST.length; i++)
would be better allows easier managing of changing array sizes.
RE: Two questions by cooldude_i06 on 07-23-2006 at 03:20 AM
"Recive" is spelt wrong, it should be "Receive" as in
code: OnEvent_ChatWndReceiveMessage
.
Markee - there was nothing wrong with the for line
RE: Two questions by TechedRonan on 07-23-2006 at 03:21 AM
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.
RE: Two questions by cooldude_i06 on 07-23-2006 at 03:22 AM
quote: Originally posted by TechedRonan
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)
It works for me, I just tried it.
RE: Two questions by TechedRonan on 07-23-2006 at 03:29 AM
Yeah noticed after the post
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.
RE: Two questions[Edit: Three, check page 2] by TechedRonan on 07-23-2006 at 02:53 PM
I really don't like to bump my threads, but... Bump!
RE: Two questions[Edit: Three, check page 2] by -dt- on 07-23-2006 at 04:02 PM
quote: Originally posted by TechedRonan
I really don't like to bump my threads, but... Bump!
how about this.. insted of bumping the thread you go look at Status2ftp your self, we aren't your slaves you know.
RE: Two questions[Edit: Three, check page 2] by cloudhunter on 07-23-2006 at 06:34 PM
Hear Hear...
RE: Two questions[Edit: Three, check page 2] by TechedRonan on 07-23-2006 at 07:02 PM
Pffft, read the previous posts..
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.
Status2FTP is really confusing with all those variables, alternative ways of making functions etc.. Can't make out the part that actually sends the xml file.
|