What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [Solved] Is this possible?

Pages: (2): « First [ 1 ] 2 » Last »
[Solved] Is this possible?
Author: Message:
Jack.dd
New Member
*


Posts: 5
Joined: Dec 2007
O.P. [Solved] Is this possible?
[ Solved ]

Thanks, Jack :)

This post was edited on 12-21-2007 at 12:10 AM by Jack.dd.
12-20-2007 04:56 AM
Profile E-Mail PM Find Quote Report
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
32 / Male / Flag
Joined: Apr 2004
RE: Is this possible? (If it if possible [Request])
Well, yeh, you can do that! :P

First, you need to make an XmlHttp request for that page. Secondly, you'll need to retrieve the <body> part of it. Then, you can separate the lines and then split those arrays so you can get all information in an array with subarrays.

Now if someone could script this for you, or if you'd like to do it yourself... go for it! :)
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
12-20-2007 10:25 AM
Profile E-Mail PM Web Find Quote Report
markee
Veteran Member
*****

Avatar

Posts: 1622
Reputation: 50
36 / Male / Flag
Joined: Jan 2006
RE: Is this possible? (If it if possible [Request])
Double splits are ugly if you can just use a regex like /^(\d+)\.(\d+)\.(\d+)$/gim  But you know me, I'm one for using regex on just about anything :P

Oh and all you hae to do is once you get the page info in the xmlhttp request, use a line like
code:
var info = xmlhttp.ResponseText.getElementsByTagName("body")[0].innerHTML;
and that should get you the contents of the boy tags ;)

NB.  None of this code has been tested and may need tweaking....
[Image: markee.png]
12-20-2007 01:27 PM
Profile PM Find Quote Report
Jack.dd
New Member
*


Posts: 5
Joined: Dec 2007
O.P. RE: Is this possible? (If it if possible [Request])
[ Solved ]

Thanks, Jack :)

This post was edited on 12-21-2007 at 12:10 AM by Jack.dd.
12-20-2007 03:23 PM
Profile E-Mail PM Find Quote Report
MeEtc
Patchou's look-alike
*****

Avatar
In the Shadow Gallery once again

Posts: 2200
Reputation: 60
38 / Male / Flag
Joined: Nov 2004
Status: Away
RE: Is this possible? (If it if possible [Request])
personally, i would use split()
[Image: signature/]     [Image: sharing.png]
I cannot hear you. There is a banana in my ear.
12-20-2007 03:31 PM
Profile PM Web Find Quote Report
Jack.dd
New Member
*


Posts: 5
Joined: Dec 2007
O.P. RE: Is this possible? (If it if possible [Request])
[ Solved ]

Thanks, Jack :)

This post was edited on 12-21-2007 at 12:11 AM by Jack.dd.
12-20-2007 03:50 PM
Profile E-Mail PM Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: Is this possible? (If it if possible [Request])
Add some Debug.Trace() lines to your script and you'll quickly find out some issues with it. Eg: place a Debug.Trace("hello") line as the first line in your stateChanged() function to actually see if it is called or not (you'll see it actually IS called)... Do the same for each nested structure and each used variable to pin down where the issues are...


Anyways, for starters you have the wrong URL in your script. The URL in your script is the graphical list with all the bells and whistles, not the plain bare list you've shown in your top post in this thread.

Second, the method/property getElementsByTagName("body")[0].innerHTML doesn't work on the ResponseText property of the XMLHTTP object. The getElementsByTagName method is part of the XMLDOM object and thus you need to define that first, something like:
code:
var XMLDOM = new ActiveXObject("Microsoft.XMLDOM");
XMLDOM.loadXML(xmlhttp.ResponseText);
var userStats = XMLDOM.getElementsByTagName("body")[0].innerHTML;

But you don't need that at all, since the website (with the proper URL as listed in your first post, not the URL in the script) will already return only the plain bare list as-is.

So all you need to correct is:
code:
searchURL = "http://hiscore.runescape.com/hiscorepersonal.ws?user1=" + searchName;
.....
var userStats = xmlhttp.ResponseText.getElementsByTagName("body")[0].innerHTML;
to:
code:
searchURL = "http://hiscore.runescape.com/index_lite.ws?player=" + searchName;
.....
var userStats = xmlhttp.ResponseText;

IMPORTANT EDIT:

Oh... and the stateChanged function should return true or false, not a string!

And since this http request is done assyncroniously, you must not do
code:
ChatWnd.SendMessage(searchStats(Username));

Not only will searchStats return nothing (you don't have any return statement there), you also don't know if it was succesfully or not.

So you must pass the contact's email to this function instead. This because you must re-open the chat window, check if you can send a string, and then actually send the string if it was succesfully.

The reason for that is because it is assyncroniously and that means the chat window can already be closed by the time the http request returns anything....

This post was edited on 12-20-2007 at 05:08 PM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
12-20-2007 04:53 PM
Profile PM Find Quote Report
Jack.dd
New Member
*


Posts: 5
Joined: Dec 2007
O.P. RE: Is this possible? (If it if possible [Request])
[ Solved ]

Thanks, Jack :)

This post was edited on 12-21-2007 at 12:11 AM by Jack.dd.
12-20-2007 06:24 PM
Profile E-Mail PM Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: Is this possible? (If it if possible [Request])
Because you can not use ChatWnd.SendMessage() like that as I explained in my previous post.

Do as I suggested and place some Debug.Trace() lines here and there, you'll see that it does work, except for the mistakes I've pointed out....

;)

Tip: also read the official scripting documentation in regards to the functions SendMessage, OpenChat, etc. It will help a lot.

This post was edited on 12-20-2007 at 09:31 PM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
12-20-2007 09:30 PM
Profile PM Find Quote Report
Jack.dd
New Member
*


Posts: 5
Joined: Dec 2007
O.P. RE: [Solved] Is this possible?
Thank you guys for helping me to get it to work :)
12-21-2007 12:12 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