What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Show status of a server in my personal message

Pages: (2): « First « 1 [ 2 ] Last »
Show status of a server in my personal message
Author: Message:
elliotmoso
New Member
*


Posts: 10
Joined: Sep 2007
O.P. RE: Show status of a server in my personal message
what version of IE do you use??
09-15-2007 05:27 PM
Profile E-Mail PM Find Quote Report
Spunky
Former Super Mod
*****

Avatar

Posts: 3658
Reputation: 61
36 / Male / Flag
Joined: Aug 2006
RE: Show status of a server in my personal message
I use IE7, but a lot of people with older browsers, or different browsers, can use scripts with this code in it... The error you described usually happens when something is either wrong with the code (which there shouldn't be), or the user doesn't have admin rights...
<Eljay> "Problems encountered: shit blew up" :zippy:
09-15-2007 05:29 PM
Profile PM Find Quote Report
elliotmoso
New Member
*


Posts: 10
Joined: Sep 2007
O.P. RE: Show status of a server in my personal message
I see the error, the activeX is not the same as that I use.

code:
function OnEvent_Initialize(){
    http_request = new ActiveXObject("Msxml2.XMLHTTP");
    http_request.open('GET', "http://elliotmoso.com", true);
    http_request.onreadystatechange = event;
    http_request.send();
}

function event(){
    if (http_request.readyState == '4') {
        if (http_request.status != '404') {
            Messenger.MyPersonalMessage="[c=9]  &#9679;  [/c]www.elliotmoso.com funciona correctamente";       
        }else{
            Messenger.MyPersonalMessage="[c=4]  &#9679;  [/c]www.elliotmoso.com está caido el servidor";
        }
    }
}

09-15-2007 05:32 PM
Profile E-Mail PM Find Quote Report
Spunky
Former Super Mod
*****

Avatar

Posts: 3658
Reputation: 61
36 / Male / Flag
Joined: Aug 2006
RE: Show status of a server in my personal message
change the line
code:
        if (http_request.status != '404') {
to:
code:
        if (http_request.status != '12007) {


Updated previous post earlier ;)

This post was edited on 09-15-2007 at 05:34 PM by Spunky.
<Eljay> "Problems encountered: shit blew up" :zippy:
09-15-2007 05:33 PM
Profile PM Find Quote Report
elliotmoso
New Member
*


Posts: 10
Joined: Sep 2007
O.P. RE: Show status of a server in my personal message
I edited it to add new functions.

code:
web = "http://www.elliotmoso.com";
function OnEvent_Initialize(){
    http_request = new ActiveXObject("Msxml2.XMLHTTP");
    http_request.open('GET', web, true);
    http_request.onreadystatechange = event;
    http_request.send();
}

function OnEvent_Timer(sTimerId){
    if(sTimerId == "RefreshPSM"){
    http_request = new ActiveXObject("Msxml2.XMLHTTP");
    http_request.open('GET', web, true);
    http_request.onreadystatechange = event;
    http_request.send();
    MsgPlus.AddTimer("RefreshPSM",60000);
    }
}

function event(){
    if (http_request.readyState != '4') {
               Messenger.MyName = "Cargando datos desde el server";
               }else{
        if (http_request.status == '404') {
            Messenger.MyName = "[c=9]  &#9679;  [/c]Estado de la web[c=9]  "+ web +" funciona correctamente[/c]";       
        }else{
            Messenger.MyName = "[c=4]  &#9679;  [/c]Estado de la web[c=4]  "+ web +" el servidor está caido[/c]";
        }
        MsgPlus.AddTimer("RefreshPSM",60000);
    }
}

This can change the url fastly, it Refreshes it every minute and it shows it in the nickname (becouse the colors).

This post was edited on 09-15-2007 at 09:37 PM by elliotmoso.
09-15-2007 07:13 PM
Profile E-Mail PM Find Quote Report
elliotmoso
New Member
*


Posts: 10
Joined: Sep 2007
O.P. RE: Show status of a server in my personal message
Hi guys I edited some the script but the state of charging don't work.
here I put my code:
code:
//En la variable web solo poner el dominio sin http:// ni www.  //
web = "elliotmoso.com";
metodo = true;  //GET=true POST=false
//////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////
bar = 0;
barra = 0;
if(metodo==true){
tipo = "GET";
}else{
tipo = "POST";
}
function OnEvent_Initialize(){
    http_request = new ActiveXObject("Msxml2.XMLHTTP");
    http_request.open(tipo, "http://www."+web+"/", true);
    http_request.onreadystatechange = event;
    http_request.send();
}

function OnEvent_Timer(sTimerId){
    if(sTimerId == "Recargar"){
    http_request = new ActiveXObject("Msxml2.XMLHTTP");
    http_request.open(tipo, "http://www."+web+"/", true);
    http_request.onreadystatechange = event;
    http_request.send();
    MsgPlus.AddTimer("Recargar",120000);
    }
    if(sTimerId == "Cargando"){
    if(barra <= 3){
    barra = ++bar;
    }else{
    barra = 0;
    bar = 0;
    }
    MsgPlus.AddTimer("Cargando", 500);
    }

}


function event(){
if (http_request.readyState <= 3) {
                   if (barra==0){
                Messenger.MyPersonalMessage = "Cargando [c=3][/c][c=4]&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;[/c]";
            }else if (barra==1){
                Messenger.MyPersonalMessage = "Cargando [c=3]&#9608;&#9608;[/c][c=4]&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;[/c]";
            }else if (barra==2){
                Messenger.MyPersonalMessage = "Cargando [c=3]&#9608;&#9608;&#9608;&#9608;[/c][c=4]&#9608;&#9608;&#9608;&#9608;[/c]";
            }else if (barra==3){
                Messenger.MyPersonalMessage = "Cargando [c=3]&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;[/c][c=4]&#9608;&#9608;[/c]";
            }else if (barra==4){
                Messenger.MyPersonalMessage = "Cargando [c=3]&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;&#9608;[/c][c=4][/c]";
            }
               MsgPlus.AddTimer("Cargando",500);
    }else if (http_request.readyState == 4) {
        if (http_request.status == 200) {
            Messenger.MyPersonalMessage = "[c=3]  &#9679;  [/c]Estado del Servidor: [c=3]  "+ web +": ·> OnLinE[/c]";       
        }else if (http_request.status == 404 || 503){
            Messenger.MyPersonalMessage = "[c=4]  &#9679;  [/c]Estado del Servidor: [c=4]  "+ web +": ·> OfLiNe[/c]";
        }else{
               Messenger.MyPersonalMessage = "[c=14]  &#9679;  [/c]Estado del Servidor:[c=14]  "+ web +": ·> Estado no Disponible[/c]";
        }
    MsgPlus.AddTimer("Recargar",120000);
    }
}





Thanks, Elliotmoso

This post was edited on 09-17-2007 at 04:33 PM by elliotmoso.
09-17-2007 04:06 PM
Profile E-Mail PM Find Quote Report
toddy
Veteran Member
*****

Avatar
kcus uoy

Posts: 2573
Reputation: 49
– / Male / Flag
Joined: Jun 2004
RE: Show status of a server in my personal message
barra is undefined, under "bar = 0;" add "barra = 0;"
09-17-2007 04:25 PM
Profile PM Find Quote Report
elliotmoso
New Member
*


Posts: 10
Joined: Sep 2007
O.P. RE: Show status of a server in my personal message
I edited it but the status of charging (if (http_request.readyState <= 3) {) don't appears
09-17-2007 04:34 PM
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