Server uptime on debug instead of countdown

kylebeed

Member
Hi guys.
Im trying to add a UPTIME to my debug monitor instead of a countdown as im trying to do stuff that would require a Uptime instead of a countdown becuase the countdown wont be as accurate.

Heres what i have so far


fnc_debug = {
debugMonitor = true;
while {debugMonitor} do
{
_pic = (gettext (configFile >> 'CfgVehicles' >> (typeof vehicle player) >> 'picture'));
if (player == vehicle player) then
{
_pic = (gettext (configFile >> 'cfgWeapons' >> (currentWeapon player) >> 'picture'));
}
else
{
_pic = (gettext (configFile >> 'CfgVehicles' >> (typeof vehicle player) >> 'picture'));
};

_stime = 0;
if(serverTime > 36000)then{_stime = time;}else{_stime = serverTime;};
_hours = (_stime/60/60);
_hours = toArray (str _hours);
_hours resize 1;
_hours = toString _hours;
_hours = compile _hours;
_hours = call _hours;
_minutes = floor(_stime/60);
_minutes2 = _minutes - (_hours*60);
_pos = getPosATL player;

hintSilent parseText format ["
<t size='1.25' font='Bitstream'align='center' color='#0000FF'>UndeadGaming</t><br/>
<t size='1'font='Bitstream'align='left' color='#C80000'>Blood:</t><t size='1' font='Bitstream'align='right' color='#B30000'>%9</t><br/>
<t size='1'font='Bitstream'align='left'>Humanity:</t><t size='1'font='Bitstream'align='right'>%6</t><br/>
<t size='1'font='Bitstream'align='left' color='#FFFFFF'>FPS:</t><t size='1'font='Bitstream'align='right' color='#FFFFFF'>%10</t><br/>
<t size='1'font='Bitstream'align='left'>Murders:</t><t size='1'font='Bitstream'align='right'>%4</t><br/>
<t size='1'font='Bitstream'align='left'>Bandits Killed:</t><t size='1'font='Bitstream'align='right'>%5</t><br/>
<t size='1'font='Bitstream'align='left'>Zombies Killed:</t><t size='1'font='Bitstream'align='right'>%2</t><br/>
<t size='1' font='Bitstream' align='left' color='#FFBF00'>UPTIME: </t><t size='1' font='Bitstream' align='right'>%5h %3min</t><br/>
<t size='0.8'font='Bitstream'align='center'>Right Ctrl key to toggle</t><br />",

(name player), //1
(player getVariable['zombieKills', 0]), //2
(player getVariable['headShots', 0]), //3
(player getVariable['humanKills', 0]), //4
(player getVariable['banditKills', 0]), //5
(player getVariable['humanity', 0]), //6
(dayz_Survived), //7
(count playableUnits), //8
r_player_blood,
_hours,
_minutes2,
(round diag_fps), //10
({isPlayer _x} count (getPos vehicle player nearEntities [["AllVehicles"], 250000])), //11
viewdistance, //12
((count([6800, 9200, 0] nearEntities [["Car","Motorcycle","Air","Ship"],25000]))+200), //13
((count vehicles) + 200), //14
(gettext (configFile >> 'CfgVehicles' >> (typeof vehicle player) >> 'displayName')), //15
(count entities "zZombie_Base"), //16
({alive _x} count entities "zZombie_Base"), //17
(getPosASL player), //18
(mapGridPosition getPos player), //19
(count([6800, 9200, 0] nearEntities [["Ship"],25000])), //20
(round(getDir player)), //21
//22
_pic, //23
({isPlayer _x} count (getPos vehicle player nearEntities [["AllVehicles"], 1000]))
];

sleep 1;
};


I get the UPTIME there but it stays at 1min and wont go up.


Any help would be appreciated :)
 
Replace _minutes2 with:
Code:
(round(serverTime / 60))

And replace _hours with:
Code:
(round(serverTime / 3600))

Thanks for the help dude. but now when i load into the server the UPTIME is set a 8mins. Anyway to fix that ?
 
There is some delay in the time it takes to start up the server. To fix just subtract the start up time in seconds (480 for 8 minutes). That seems kind of long though, 3 minutes (180s) seems more realistic.
Code:
(round((serverTime-480)/60))
Code:
(round((serverTime-480)/3600))

should work


Okay but it stays at 8mins ever after a minute or so passes
 
Make sure you deleted all this:
Code:
_stime = 0;
if(serverTime > 36000)then{_stime = time;}else{_stime = serverTime;};
_hours = (_stime/60/60);
_hours = toArray (str _hours);
_hours resize 1;
_hours = toString _hours;
_hours = compile _hours;
_hours = call _hours;
_minutes = floor(_stime/60);
_minutes2 = _minutes - (_hours*60);

Change this:
Code:
<t size='1' font='Bitstream' align='left' color='#FFBF00'>UPTIME: </t><t size='1' font='Bitstream' align='right'>%5h %3min</t><br/>

To this:
Code:
<t size='1' font='Bitstream' align='left' color='#FFBF00'>UPTIME: </t><t size='1' font='Bitstream' align='right'>%10h %11min</t><br/>

And change these:
Code:
_hours,
_minutes2,

To these:
Code:
(round(serverTime / 3600))
(round(serverTime / 60))








Works perfect now :) thanks.


Also could i ask about your day/night cycle script?

In your bat files you have

echo off

taskkill /f /fi "status eq not responding" /im arma2oaserver.exe
taskkill /f /im arma2oaserver.exe
timeout 1

taskkill /f /fi "status eq not responding" /im arma2oa.exe
taskkill /f /im arma2oa.exe
timeout 1

taskkill /im Bec.exe
timeout 1

cd A:\cfgdayz
start "" "rotate_logs.bat"
timeout 5

xcopy /Y A:\cfgdayz\day\HiveExt.ini A:\cfgdayz\
timeout 1

cd A:\Arma2\SteamApps\common\Arma 2 Operation Arrowhead

start "arma2" /high "Expansion\beta\arma2oaserver.exe" -port=2302 "-config=A:\config.cfg" "-cfg=A:\basic.cfg" "-profiles=A:\cfgdayz" -name=cfgdayz "-mod=@DayZ_Epoch;@DayZ_Epoch_Server;" -nosplash -noSound -noPause -bandwidthAlg=2
timeout 6

set becpath="A:\Bec\"
cd /d %becpath%
start "" "Bec.exe" -f Config.cfg


and

@Echo off

taskkill /f /fi "status eq not responding" /im arma2oaserver.exe
taskkill /f /im arma2oaserver.exe
timeout 1

taskkill /f /fi "status eq not responding" /im arma2oa.exe
taskkill /f /im arma2oa.exe
timeout 1

taskkill /im Bec.exe
timeout 1

cd A:\cfgdayz
start "" "rotate_logs.bat"
timeout 5

xcopy /Y A:\cfgdayz\night\HiveExt.ini A:\cfgdayz\
timeout 5

cd A:\Arma2\SteamApps\common\Arma 2 Operation Arrowhead

start "arma2" /high "Expansion\beta\arma2oaserver.exe" -port=2302 "-config=A:\config.cfg" "-cfg=A:\basic.cfg" "-profiles=A:\cfgdayz" -name=cfgdayz "-mod=@DayZ_Epoch;@DayZ_Epoch_Server;" -nosplash -noSound -noPause -bandwidthAlg=2
timeout 3

set becpath="A:\Bec\"
cd /d %becpath%
start "" "Bec.exe" -f Config.cfg
timeout 1


Which is completely different to mine


@Echo off
echo.
echo KILL arma2oaserver.exe
set serverkill="D:\DayZ Server (OPC)\Expansion\beta"
cd /d %serverkill%
taskkill /im arma2oaserverOverPoch.exe
echo.
echo Kill Bec14.exe
set beckill="D:\Servertools (OPC)"
cd /d %beckill%
taskkill /im bec14.exe

timeout 2

echo.
echo Starting Dayz Server
:: start the server
set dayzpath="D:\DayZ Server (OPC)"
cd /d %dayzpath%
start "" "D:\DayZ Server (OPC)\DayZ_Epoch_instance_11_OverPoch.bat"
echo.
echo Starting Bec
timeout 2
:: start bec
set becpath="D:\Servertools (OPC)"
cd /d %becpath%
start "" "D:\Servertools (OPC)\start14.bat" -f Config.cfg
echo.
echo Server Started 100%

cls
@exit

How would i make the change of hiveexts? with mine.


Thanks.
 
Create two new folders in your config directory (where you have config.cfg) called day and night. Copy HiveExt.ini to both and change the hour on the night one.

^ Right after your timeout 2 switch to the config directory and swap the HiveExt.ini:
Code:
xcopy /Y C:\YourConfigDirectory\night\HiveExt.ini C:\YourConfigDirectory\
timeout 1


Okay but which timeout 2? I have 2
 
Actually i did it at both and used this


xcopy /Y D:\DayZ Server (OPS)\instance_11_OverPoch\night\HiveExt.ini D:\DayZ Server (OPS)\instance_11_OverPoch\
timeout 1



which matches what needs changed. but it still doesnt copy :/
 
Got it !


xcopy /Y "D:\DayZ Server (OPS)\instance_11_OverPoch\night\HiveExt.ini" "D:\DayZ Server (OPS)\instance_11_OverPoch"



Just added comas
 
Make sure you deleted all this:
Code:
_stime = 0;
if(serverTime > 36000)then{_stime = time;}else{_stime = serverTime;};
_hours = (_stime/60/60);
_hours = toArray (str _hours);
_hours resize 1;
_hours = toString _hours;
_hours = compile _hours;
_hours = call _hours;
_minutes = floor(_stime/60);
_minutes2 = _minutes - (_hours*60);

Change this:
Code:
<t size='1' font='Bitstream' align='left' color='#FFBF00'>UPTIME: </t><t size='1' font='Bitstream' align='right'>%5h %3min</t><br/>

To this:
Code:
<t size='1' font='Bitstream' align='left' color='#FFBF00'>UPTIME: </t><t size='1' font='Bitstream' align='right'>%10h %11min</t><br/>

And change these:
Code:
_hours,
_minutes2,

To these:
Code:
(round(serverTime / 3600))
(round(serverTime / 60))

ive got the minutes working on the debug but after 30min it turns to 1 on the hour for some reason? How can i fix this?
 
Back
Top