Two questions[Edit: Three, check page 2] |
Author: |
Message: |
TechedRonan
New Member
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
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 |
|
|
TechedRonan
New Member
Duja
Posts: 12
Joined: Jul 2006
|
O.P. RE: Two questions
Bump, no one answers.
|
|
07-23-2006 02:45 AM |
|
|
Silentdragon
Full Member
if(life==null && wrists) EmoAlert();
Posts: 148 Reputation: 2
34 / / –
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 |
|
|
cooldude_i06
Full Member
I'm so cool I worry myself.
Posts: 272 Reputation: 9
– / / –
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.
|
|
07-23-2006 02:54 AM |
|
|
markee
Veteran Member
Posts: 1622 Reputation: 50
36 / /
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.
|
|
07-23-2006 03:00 AM |
|
|
TechedRonan
New Member
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 |
|
|
markee
Veteran Member
Posts: 1622 Reputation: 50
36 / /
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
|
|
07-23-2006 03:17 AM |
|
|
Silentdragon
Full Member
if(life==null && wrists) EmoAlert();
Posts: 148 Reputation: 2
34 / / –
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 |
|
|
cooldude_i06
Full Member
I'm so cool I worry myself.
Posts: 272 Reputation: 9
– / / –
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.
|
|
07-23-2006 03:20 AM |
|
|
TechedRonan
New Member
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 |
|
|
Pages: (2):
« First
[ 1 ]
2
»
Last »
|
|