Jump to content
  • 0

server uptime error.


Question

Posted (edited)

prontera,159,187,4    script   Server Uptime    858,{
function Add_Zero; function Add_S;

    mes
        "[Uptime]",
        "The server has been online for ",
        ((.t[1])?Add_S(.t[1],"day")+", ":"")+
        ((.t[2])?Add_S(.t[2],"hour")+", ":"")+
        ((.t[2]||.t[3])?Add_S(.t[3],"minute")+" ":"")+
        ((getarraysize(.t)>2)?"and ":"")+Add_S(.t[4],"second")+", "+
        "and counting!";
    close;

    function Add_Zero { return ((getarg(0)<10)?"0":"")+getarg(0); }
    function Add_S { return "^0055FF"+getarg(0)+" "+getarg(1)+((getarg(0)==1)?"":"s")+"^000000"; }

OnInit:
    set .t[0], gettimetick(2);
    waitingroom " [ 00:00:00 ]",0;
    initnpctimer;
    end;

OnTimer950:
    set .@t, gettimetick(2)-.t[0];
    set .t[1], .@t/(3600*24);
    set .t[2], .@t/3600-.t[1]*24;
    set .t[3], .@t/60-.t[2]*60;
    set .t[4], .@t%60;
    end;

OnTimer990:
    initnpctimer;
    delwaitingroom;
    waitingroom " [ "+Add_Zero(.t[1])+":"+Add_Zero(.t[2])+":"+Add_Zero(.t[3])+":"+Add_Zero(.t[4])+" ]",0;
    end;
}
 

 

found bug on this script.. if the server run for 12days its

show like this dd:hh:mm:ss 12:00:1234124:00 the day wll not increase the time

will add at minute..

 

then how to change this script like read when the server 1st start.

Edited by Cisqua

1 answer to this question

Recommended Posts

Posted


prontera,159,187,4 script Server Uptime 858,{

function Add_Zero; function Add_S;

mes

"[Uptime]",

"The server has been online for ",

((.t[1])?Add_S(.t[1],"day")+", ":"")+

((.t[2])?Add_S(.t[2],"hour")+", ":"")+

((.t[2]||.t[3])?Add_S(.t[3],"minute")+" ":"")+

((getarraysize(.t)>2)?"and ":"")+Add_S(.t[4],"second")+", "+

"and counting!";

close;

function Add_Zero { return ((getarg(0)<10)?"0":"")+getarg(0); }

function Add_S { return "^0055FF"+getarg(0)+" "+getarg(1)+((getarg(0)==1)?"":"s")+"^000000"; }

OnInit:

set .t[0], gettimetick(2);

// set .t[0], gettimetick(2) - 3600*24 + 10;

waitingroom " [ 00:00:00 ]",0;

initnpctimer;

end;

OnTimer990:

set .@t, gettimetick(2)-.t[0];

set .t[1], .@t/(3600*24);

set .t[2], ( .@t%(3600*24) )/3600;

set .t[3], (( .@t%(3600*24) )%3600 )/60;

set .t[4], (( .@t%(3600*24) )%3600 )%60;

end;

OnTimer995:

initnpctimer;

delwaitingroom;

waitingroom " [ "+Add_Zero(.t[1])+":"+Add_Zero(.t[2])+":"+Add_Zero(.t[3])+":"+Add_Zero(.t[4])+" ]",0;

end;

}

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...