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 |
|
|
Spunky
Former Super Mod
Posts: 3658 Reputation: 61
36 / /
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"
|
|
09-15-2007 05:29 PM |
|
|
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] ● [/c]www.elliotmoso.com funciona correctamente";
}else{
Messenger.MyPersonalMessage="[c=4] ● [/c]www.elliotmoso.com está caido el servidor";
}
}
}
|
|
09-15-2007 05:32 PM |
|
|
Spunky
Former Super Mod
Posts: 3658 Reputation: 61
36 / /
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"
|
|
09-15-2007 05:33 PM |
|
|
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] ● [/c]Estado de la web[c=9] "+ web +" funciona correctamente[/c]";
}else{
Messenger.MyName = "[c=4] ● [/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 |
|
|
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]████████[/c]";
}else if (barra==1){
Messenger.MyPersonalMessage = "Cargando [c=3]██[/c][c=4]██████[/c]";
}else if (barra==2){
Messenger.MyPersonalMessage = "Cargando [c=3]████[/c][c=4]████[/c]";
}else if (barra==3){
Messenger.MyPersonalMessage = "Cargando [c=3]██████[/c][c=4]██[/c]";
}else if (barra==4){
Messenger.MyPersonalMessage = "Cargando [c=3]████████[/c][c=4][/c]";
}
MsgPlus.AddTimer("Cargando",500);
}else if (http_request.readyState == 4) {
if (http_request.status == 200) {
Messenger.MyPersonalMessage = "[c=3] ● [/c]Estado del Servidor: [c=3] "+ web +": ·> OnLinE[/c]";
}else if (http_request.status == 404 || 503){
Messenger.MyPersonalMessage = "[c=4] ● [/c]Estado del Servidor: [c=4] "+ web +": ·> OfLiNe[/c]";
}else{
Messenger.MyPersonalMessage = "[c=14] ● [/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 |
|
|
toddy
Veteran Member
kcus uoy
Posts: 2573 Reputation: 49
– / /
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 |
|
|
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 |
|
|
Pages: (2):
« First
«
1
[ 2 ]
Last »
|
|