Shoutbox

Script Update Issues - 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: Script Update Issues (/showthread.php?tid=79374)

Script Update Issues by ArkaneArkade on 11-26-2007 at 09:08 AM

Hey guys, I need some help with a couple of problems I'm having.

First, is that messenger keeps bringing up a box telling me "I've signed in as busy, do I want to change to Online" every single time I sign-on.  I've changed the default status several times, but it still instantly makes me busy when I get online.  It started happening after I copied a bit of script from a post by CookieRevised, to remember status by changing the sign-on status.  This was when it started, but I don't think its the problem, because I've since deleted the entire key from the registry and its still happening.


My second problem is with a script.  I've tried to add an update checker to it, adapted from mpscripts.net, but it won't work properly for me.  Sometimes it works, sometimes it doesnt.  Last time I looked, it wasn't coming up with anything.  The Debug.Trace worked to show me the response text, but the versions just dont seem to compare.  I double checked with the version numbers, but they just wont do anything.  Can anyone give me any help with this?  The ScriptVersion being used is 2.0.0.0 for the comparison to that site.

code:
function CheckforUpdates()
{
    var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    xmlhttp.open("GET","http://www.arkanes-arkade.co.uk/XBMC-Script/Version.txt" , true);
    xmlhttp.send(Math.round(Math.random()*99999));
    xmlhttp.onreadystatechange=function()
    {
        if(xmlhttp.readyState==4)
        {
            var resp = xmlhttp.responseText;
            Debug.Trace("Response = "+resp);
            if(resp != "Current Version: " + ScriptVersion)
            {
                resp=resp.split(" ");
                if(resp[2]>ScriptVersion)
                {
                    MsgPlus.DisplayToast("XBMC", "Script Update Available!\nClick here to download now", "", "NewVersionAvailable");
                }
            }
        }
    xmlhttp.close;
    }
}

Cheers guys :S
RE: Script Update Issues by markee on 11-26-2007 at 09:24 AM

well for one thing you should be using resp[1] rather than resp[2] because Arrays are base zero in JScript.  Also you may need to check that the text string works properly when comparing them with the multiple points.  You may neev to split them aroung the .'s and compare the build numbers individually.


RE: Script Update Issues by ArkaneArkade on 11-26-2007 at 02:38 PM

Thank you very much markee.  Ten seconds and its working perfectly - no need to split around the points.  :D


RE: Script Update Issues by ArkaneArkade on 11-28-2007 at 07:34 PM

Ok, I'm sorry to bring this up again, but the script has stopped working.  I've been forced to update my host, and this seems pretty obviously the issue.  It's not something wrong in my script, just maybe there might be another way around.

What happens now is when I query the text file I get a load of HTML instead of the "Version: 2.5.0.1" which is actually in the text file, and was returned before the host was changed.

I debugged the reply and this is what I got.  Could anyone suggest an alternate method to retrive the info?

code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<HTML><HEAD><TITLE>The page cannot be displayed</TITLE>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=Windows-1252">
<STYLE type="text/css">
  BODY { font: 8pt/12pt verdana }
  H1 { font: 13pt/15pt verdana }
  H2 { font: 8pt/12pt verdana }
  A:link { color: red }
  A:visited { color: maroon }
</STYLE>
</HEAD><BODY><TABLE width=500 border=0 cellspacing=10><TR><TD>

<h1>The page cannot be displayed</h1>
The page you are looking for cannot be displayed because an invalid method (HTTP verb) was used to attempt access.
<hr>
<p>Please try the following:</p>
<ul>
<li>Contact the Web site administrator if you believe that this request should be allowed.</li>
<li>Make sure that the Web site address displayed in the address bar of your browser is spelled and formatted correctly. </li>
</ul>
<h2>HTTP Error 405 - The HTTP verb used to access this page is not allowed.<br>Internet Information Services (IIS)</h2>
<hr>
<p>Technical Information (for support personnel)</p>
<ul>
<li>Go to <a href="http://go.microsoft.com/fwlink/?linkid=8180">Microsoft Product Support Services</a> and perform a title search for the words <b>HTTP</b> and <b>405</b>.</li>
<li>Open <b>IIS Help</b>, which is accessible in IIS Manager (inetmgr),
and search for topics titled <b>Setting Application Mappings</b>, <b>Securing Your Site with Web Site Permissions</b>, and <b>About Custom Error Messages</b>.</li>
</ul>

</TD></TR></TABLE></BODY></HTML>