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

[Solved] Is this possible?
Author: Message:
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
« Next Oldest Return to Top Next Newest »

Messages In This Thread
[Solved] Is this possible? - by Jack.dd on 12-20-2007 at 04:56 AM
RE: Is this possible? (If it if possible [Request]) - by Matti on 12-20-2007 at 10:25 AM
RE: Is this possible? (If it if possible [Request]) - by markee on 12-20-2007 at 01:27 PM
RE: Is this possible? (If it if possible [Request]) - by Jack.dd on 12-20-2007 at 03:23 PM
RE: Is this possible? (If it if possible [Request]) - by MeEtc on 12-20-2007 at 03:31 PM
RE: Is this possible? (If it if possible [Request]) - by Jack.dd on 12-20-2007 at 03:50 PM
RE: Is this possible? (If it if possible [Request]) - by CookieRevised on 12-20-2007 at 04:53 PM
RE: Is this possible? (If it if possible [Request]) - by Jack.dd on 12-20-2007 at 06:24 PM
RE: Is this possible? (If it if possible [Request]) - by CookieRevised on 12-20-2007 at 09:30 PM
RE: [Solved] Is this possible? - by Jack.dd on 12-21-2007 at 12:12 AM
RE: [Solved] Is this possible? - by Spunky on 12-21-2007 at 12:23 AM
RE: [Solved] Is this possible? - by freak544 on 12-21-2007 at 12:27 AM
RE: [Solved] Is this possible? - by MicroWay on 12-21-2007 at 01:11 AM
RE: [Solved] Is this possible? - by riahc4 on 12-21-2007 at 12:36 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