Jump to content
  • 0

Server Restart In Debug Monitor?


QCube

Question

Hi There,

 

I'm trying to get the my debug monitor to show the correct time before server restarts. I have a BEC setup to restart every 4 hours.

  • 06:00
  • 10:00
  • 14:00
  • 18:00
  • 22:00
  • 02:00
Here Is the commands I have in place for it.

<!-- *** RESTARTS *** -->
	<!-- 15 min to the 06.00am restart -->
	<job id="0">
		<time>05:45:00</time>
		<delay>000000</delay>
		<day>1,2,3,4,5,6,7</day>
		<loop>0</loop> 
		<cmd>say -1 THIS SERVER WILL RESTART IN 15 MINUTES.</cmd>
		<cmdtype>0</cmdtype>			
	</job>
	
		<job id="1">
		<time>05:50:00</time>
		<delay>000000</delay>
		<day>1,2,3,4,5,6,7</day>
		<loop>0</loop> 
		<cmd>say -1 THIS SERVER WILL RESTART IN 10 MINUTES.</cmd>
		<cmdtype>0</cmdtype>			
	</job>
	
		<job id="2">
		<time>05:55:00</time>
		<delay>000000</delay>
		<day>1,2,3,4,5,6,7</day>
		<loop>0</loop> 
		<cmd>say -1 THIS SERVER WILL RESTART IN 5 MINUTES.</cmd>
		<cmdtype>0</cmdtype>			
	</job>
	
		<job id="3">
		<time>05:58:00</time>
		<delay>000000</delay>
		<day>1,2,3,4,5,6,7</day>
		<loop>0</loop> 
		<cmd>say -1 THIS SERVER WILL RESTART IN 2 MINUTES.</cmd>
		<cmdtype>0</cmdtype>			
	</job>
	
		<job id="4">
		<time>05:59:00</time>
		<delay>000000</delay>
		<day>1,2,3,4,5,6,7</day>
		<loop>0</loop> 
		<cmd>say -1 THIS SERVER WILL RESTART IN 1 MINUTE.</cmd>
		<cmdtype>0</cmdtype>			
	</job>
	
	<job id="5">
		<time>06:00:00</time>
		<delay>000000</delay>
		<day>1,2,3,4,5,6,7</day>
		<loop>0</loop> 
		<cmd>#shutdown</cmd>
		<cmdtype>0</cmdtype>		
	</job>
	
	<!-- end 6 am restart -->
	
	
	
	
	<!-- begin 15 mins until 10:00am restart -->
	
	
		<job id="6">
		<time>09:45:00</time>
		<delay>000000</delay>
		<day>1,2,3,4,5,6,7</day>
		<loop>0</loop> 
		<cmd>say -1 THIS SERVER WILL RESTART IN 15 MINUTES.</cmd>
		<cmdtype>0</cmdtype>			
	</job>
	
		<job id="7">
		<time>09:50:00</time>
		<delay>000000</delay>
		<day>1,2,3,4,5,6,7</day>
		<loop>0</loop> 
		<cmd>say -1 THIS SERVER WILL RESTART IN 10 MINUTES.</cmd>
		<cmdtype>0</cmdtype>			
	</job>
	
		<job id="8">
		<time>09:55:00</time>
		<delay>000000</delay>
		<day>1,2,3,4,5,6,7</day>
		<loop>0</loop> 
		<cmd>say -1 THIS SERVER WILL RESTART IN 5 MINUTES.</cmd>
		<cmdtype>0</cmdtype>			
	</job>
	
		<job id="9">
		<time>09:58:00</time>
		<delay>000000</delay>
		<day>1,2,3,4,5,6,7</day>
		<loop>0</loop> 
		<cmd>say -1 THIS SERVER WILL RESTART IN 2 MINUTES.</cmd>
		<cmdtype>0</cmdtype>			
	</job>
	
		<job id="10">
		<time>09:59:00</time>
		<delay>000000</delay>
		<day>1,2,3,4,5,6,7</day>
		<loop>0</loop> 
		<cmd>say -1 THIS SERVER WILL RESTART IN 1 MINUTE.</cmd>
		<cmdtype>0</cmdtype>			
	</job>
	
	<job id="11">
		<time>10:00:00</time>
		<delay>000000</delay>
		<day>1,2,3,4,5,6,7</day>
		<loop>0</loop> 
		<cmd>#shutdown</cmd>
		<cmdtype>0</cmdtype>		
	</job>
	
	<!-- end 10.00am restart -->
	
	<!-- begin 15 mins until 14:00 restart -->
	
		<job id="12">
		<time>13:45:00</time>
		<delay>000000</delay>
		<day>1,2,3,4,5,6,7</day>
		<loop>0</loop> 
		<cmd>say -1 THIS SERVER WILL RESTART IN 15 MINUTES.</cmd>
		<cmdtype>0</cmdtype>			
	</job>
	
		<job id="13">
		<time>13:50:00</time>
		<delay>000000</delay>
		<day>1,2,3,4,5,6,7</day>
		<loop>0</loop> 
		<cmd>say -1 THIS SERVER WILL RESTART IN 10 MINUTES.</cmd>
		<cmdtype>0</cmdtype>			
	</job>
	
		<job id="14">
		<time>13:55:00</time>
		<delay>000000</delay>
		<day>1,2,3,4,5,6,7</day>
		<loop>0</loop> 
		<cmd>say -1 THIS SERVER WILL RESTART IN 5 MINUTES.</cmd>
		<cmdtype>0</cmdtype>			
	</job>
	
		<job id="15">
		<time>13:58:00</time>
		<delay>000000</delay>
		<day>1,2,3,4,5,6,7</day>
		<loop>0</loop> 
		<cmd>say -1 THIS SERVER WILL RESTART IN 2 MINUTES.</cmd>
		<cmdtype>0</cmdtype>			
	</job>
	
		<job id="16">
		<time>13:59:00</time>
		<delay>000000</delay>
		<day>1,2,3,4,5,6,7</day>
		<loop>0</loop> 
		<cmd>say -1 THIS SERVER WILL RESTART IN 1 MINUTE.</cmd>
		<cmdtype>0</cmdtype>			
	</job>
	
	<job id="17">
		<time>14:00:00</time>
		<delay>000000</delay>
		<day>1,2,3,4,5,6,7</day>
		<loop>0</loop> 
		<cmd>#shutdown</cmd>
		<cmdtype>0</cmdtype>		
	</job>
	
	<!-- end 14.00 restart -->
	
	<!-- begin 15 mins until 18:00 restart -->
	
		<job id="18">
		<time>17:45:00</time>
		<delay>000000</delay>
		<day>1,2,3,4,5,6,7</day>
		<loop>0</loop> 
		<cmd>say -1 THIS SERVER WILL RESTART IN 15 MINUTES.</cmd>
		<cmdtype>0</cmdtype>			
	</job>
	
		<job id="19">
		<time>17:50:00</time>
		<delay>000000</delay>
		<day>1,2,3,4,5,6,7</day>
		<loop>0</loop> 
		<cmd>say -1 THIS SERVER WILL RESTART IN 10 MINUTES.</cmd>
		<cmdtype>0</cmdtype>			
	</job>
	
		<job id="20">
		<time>17:55:00</time>
		<delay>000000</delay>
		<day>1,2,3,4,5,6,7</day>
		<loop>0</loop> 
		<cmd>say -1 THIS SERVER WILL RESTART IN 5 MINUTES.</cmd>
		<cmdtype>0</cmdtype>			
	</job>
	
		<job id="21">
		<time>17:58:00</time>
		<delay>000000</delay>
		<day>1,2,3,4,5,6,7</day>
		<loop>0</loop> 
		<cmd>say -1 THIS SERVER WILL RESTART IN 2 MINUTES.</cmd>
		<cmdtype>0</cmdtype>			
	</job>
	
		<job id="22">
		<time>17:59:00</time>
		<delay>000000</delay>
		<day>1,2,3,4,5,6,7</day>
		<loop>0</loop> 
		<cmd>say -1 THIS SERVER WILL RESTART IN 1 MINUTE.</cmd>
		<cmdtype>0</cmdtype>			
	</job>
	
	<job id="23">
		<time>18:00:00</time>
		<delay>000000</delay>
		<day>1,2,3,4,5,6,7</day>
		<loop>0</loop> 
		<cmd>#shutdown</cmd>
		<cmdtype>0</cmdtype>		
	</job>
	
	<!-- end 18:00 restart -->
	
	<!-- begin 15 mins until 22:00 restart -->
	
		<job id="24">
		<time>21:45:00</time>
		<delay>000000</delay>
		<day>1,2,3,4,5,6,7</day>
		<loop>0</loop> 
		<cmd>say -1 THIS SERVER WILL RESTART IN 15 MINUTES.</cmd>
		<cmdtype>0</cmdtype>			
	</job>
	
		<job id="25">
		<time>21:50:00</time>
		<delay>000000</delay>
		<day>1,2,3,4,5,6,7</day>
		<loop>0</loop> 
		<cmd>say -1 THIS SERVER WILL RESTART IN 10 MINUTES.</cmd>
		<cmdtype>0</cmdtype>			
	</job>
	
		<job id="26">
		<time>21:55:00</time>
		<delay>000000</delay>
		<day>1,2,3,4,5,6,7</day>
		<loop>0</loop> 
		<cmd>say -1 THIS SERVER WILL RESTART IN 5 MINUTES.</cmd>
		<cmdtype>0</cmdtype>			
	</job>
	
		<job id="27">
		<time>21:58:00</time>
		<delay>000000</delay>
		<day>1,2,3,4,5,6,7</day>
		<loop>0</loop> 
		<cmd>say -1 THIS SERVER WILL RESTART IN 2 MINUTES.</cmd>
		<cmdtype>0</cmdtype>			
	</job>
	
		<job id="28">
		<time>21:59:00</time>
		<delay>000000</delay>
		<day>1,2,3,4,5,6,7</day>
		<loop>0</loop> 
		<cmd>say -1 THIS SERVER WILL RESTART IN 1 MINUTE.</cmd>
		<cmdtype>0</cmdtype>			
	</job>
	
	<job id="29">
		<time>22:00:00</time>
		<delay>000000</delay>
		<day>1,2,3,4,5,6,7</day>
		<loop>0</loop> 
		<cmd>#shutdown</cmd>
		<cmdtype>0</cmdtype>		
	</job>
	
	<!-- end 22:00 restart -->

	<!-- begin 15 mins until 02:00 restart -->
	
		<job id="30">
		<time>01:45:00</time>
		<delay>000000</delay>
		<day>1,2,3,4,5,6,7</day>
		<loop>0</loop> 
		<cmd>say -1 THIS SERVER WILL RESTART IN 15 MINUTES.</cmd>
		<cmdtype>0</cmdtype>			
	</job>
	
		<job id="31">
		<time>01:50:00</time>
		<delay>000000</delay>
		<day>1,2,3,4,5,6,7</day>
		<loop>0</loop> 
		<cmd>say -1 THIS SERVER WILL RESTART IN 10 MINUTES.</cmd>
		<cmdtype>0</cmdtype>			
	</job>
	
		<job id="32">
		<time>01:55:00</time>
		<delay>000000</delay>
		<day>1,2,3,4,5,6,7</day>
		<loop>0</loop> 
		<cmd>say -1 THIS SERVER WILL RESTART IN 5 MINUTES.</cmd>
		<cmdtype>0</cmdtype>			
	</job>
	
		<job id="33">
		<time>01:58:00</time>
		<delay>000000</delay>
		<day>1,2,3,4,5,6,7</day>
		<loop>0</loop> 
		<cmd>say -1 THIS SERVER WILL RESTART IN 2 MINUTES.</cmd>
		<cmdtype>0</cmdtype>			
	</job>
	
		<job id="34">
		<time>01:59:00</time>
		<delay>000000</delay>
		<day>1,2,3,4,5,6,7</day>
		<loop>0</loop> 
		<cmd>say -1 THIS SERVER WILL RESTART IN 1 MINUTE.</cmd>
		<cmdtype>0</cmdtype>			
	</job>
	
	<job id="35">
		<time>02:00:00</time>
		<delay>000000</delay>
		<day>1,2,3,4,5,6,7</day>
		<loop>0</loop> 
		<cmd>#shutdown</cmd>
		<cmdtype>0</cmdtype>		
	</job>
	
	<!-- end 02:00 restart -->

 

 

The custom debug screen Is what is slightly confusing me. Here is the script I'm using.

waitUntil {alive player};

while {true} do
{
	_kills = 		player getVariable["zombieKills",0];
	_killsH = 		player getVariable["humanKills",0];
	_killsB = 		player getVariable["banditKills",0];
	_humanity =		player getVariable["humanity",0];
	
	hintSilent parseText format ["
	<t size='1.25' font='Bitstream'align='center' color='#D60000'>DayZ Epoch</t><br/>
	<t size='1.15' font='Bitstream'align='center' color='#D60000'>www.solitary.gamingdeluxe.co.uk</t><br/>
	<t size='1.15' font='Bitstream'align='center' color='#5882FA'>Survived %2 Days</t><br/>
	<t size='0.95' font='Bitstream' align='left' color='#FFBF00'>Players Online: </t><t size='0.95 'font='Bitstream' align='right'>%3</t><br/>
	<t size='0.95' font='Bitstream' align='left' color='#FFBF00'>Murders: </t><t size='0.95' font='Bitstream' align='right'>%4</t><br/>
	<t size='0.95' font='Bitstream' align='left' color='#FFBF00'>Bandits Killed: </t><t size='0.95' font='Bitstream' align='right'>%5</t><br/>
	<t size='0.95' font='Bitstream' align='left' color='#FFBF00'>Zombies Killed: </t><t size='0.95' font='Bitstream' align='right'>%6</t><br/>
	<t size='0.95' font='Bitstream' align='left' color='#FFBF00'>Humanity: </t><t size='0.95' font='Bitstream' align='right'>%7</t><br/>
    <t size='0.95' font='Bitstream' align='left' color='#FFBF00'>Blood: </t><t size='0.95' font='Bitstream' align='right'>%8</t><br/>
    <t size='0.95' font='Bitstream' align='left' color='#FFBF00'>FPS: </t><t size='0.95' font='Bitstream' align='right'>%9</t><br/>
	<t size='1.15' font='Bitstream'align='center' color='#5882FA'>Restart in %10 Minutes</t><br/>",

	dayz_playerName,(dayz_Survived),(count playableUnits),_killsH,_killsB,_kills,round _humanity,r_player_blood,(round diag_fps),[color=#ff0000][b](round(240-(serverTime) / 60))[/b][/color]
	];
sleep 1;
};

 

The debug Is showing the wrong time before restart and I'm a little confused on how I can change it. I've changed the (serverTime) to (06:00:00) to see if that would allow it to begin the cycle repeating itself every 240 minutes thus breaking it to the cycle but It completely made my debug screen disappear. 

 

What can I do to make the debug show the correct time before restart?

 

Cheers.

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

A lot of time problems arise by trying to over complicate what you're doing to save code space and not being able to pinpoint the problem afterwards. Just glancing it seems like your parenthesis are mixed up a little.

Maybe should be (round(240-(serverTime/ 60)))

 

Try using this above where you assign the other variables then reference just that variable below and see if that changes. If it works, then add in your and mods. I do remember from a long while ago that servertime has some issues if called near the server start, but they might have fixed that since.

_STtmp=round(servertime/60);

_STIME=240-_STtmp;

Link to comment
Share on other sites

  • 0

Hi There,

 <snip> 

What can I do to make the debug show the correct time before restart?

 

Cheers.

 

Hello,

 

Below is my working code from custom debug monitor (taken from posts in forums & modified little bit) which you might re-use.

 

I don't know how your current debug mon works but the down side of the one I copied below is:

1) it is not on/off toggleable by the player (it stays on all the time) and

2) it does not show vehicle/weapon picture or name.

 

I will try and improve it with the above, if you're interested I can share with you the working code when it's ready...

 

waitUntil {alive player};

while {true} do
{
	_kills = 		player getVariable["zombieKills",0];
	_killsH = 		player getVariable["humanKills",0];
	_killsB = 		player getVariable["banditKills",0];
	_humanity =		player getVariable["humanity",0];
	_headShots =    player getVariable["headShots",0];
	
	hintSilent parseText format ["
	<t size='1.25' font='Bitstream'align='center' color='#D60000'>ServerNameHere</t><br/>
	<t size='1.15' font='Bitstream' align='left' color='#FFBF00'>Players Online: </t><t size='1.15 'font='Bitstream' align='right'>%1</t><br/>
	<t size='0.95' font='Bitstream'align='center' color='#D60000'></t><br/>
	<t size='1.15' font='Bitstream'align='center' color='#298A08'>%2</t><br/>
	<t size='1.15' font='Bitstream'align='center' color='#5882FA'>Survived %3 Days</t><br/>
	<t size='0.95' font='Bitstream'align='center' color='#D60000'></t><br/>
	<t size='0.95' font='Bitstream' align='left' color='#FFBF00'>Zombies Killed: </t><t size='0.95' font='Bitstream' align='right'>%4</t><br/>
	<t size='0.95' font='Bitstream' align='left' color='#FFBF00'>Headshots: </t><t size='0.95' font='Bitstream' align='right'>%5</t><br/>
	<t size='0.95' font='Bitstream' align='left' color='#FFBF00'>Murders: </t><t size='0.95' font='Bitstream' align='right'>%6</t><br/>
	<t size='0.95' font='Bitstream' align='left' color='#FFBF00'>Bandits Killed: </t><t size='0.95' font='Bitstream' align='right'>%7</t><br/>
	<t size='0.95' font='Bitstream' align='left' color='#FFBF00'>Humanity: </t><t size='0.95' font='Bitstream' align='right'>%8</t><br/>
    <t size='0.95' font='Bitstream' align='left' color='#FF0000'>Blood: </t><t size='0.95' font='Bitstream' align='right'>%9</t><br/>
	<t size='0.95' font='Bitstream'align='center' color='#D60000'></t><br/>
    <t size='0.95' font='Bitstream' align='left' color='#FFBF00'>FPS: </t><t size='0.95' font='Bitstream' align='right'>%10</t><br/>
	<t size='0.95' font='Bitstream'align='center' color='#D60000'></t><br/>
	<t size='1.15' font='Bitstream'align='center' color='#5882FA'>Restart in %11 Minutes</t><br/>
	<t size='0.95' font='Bitstream'align='center' color='#D60000'></t><br/>
	<t size='0.95' font='Bitstream'align='center' color='#D60000'>http://www.WebsiteHere.com</t><br/>",

	(count playableUnits),dayz_playerName,(dayz_Survived),_kills,_headShots,_killsH,_killsB,round _humanity,r_player_blood,(round diag_fps),(round(180-(serverTime) / 60))
	];
sleep 1;
};

 

 

Edit1 - The code above is for 3 hour restart cycle so you'll need to replace 180 at the end with 240 for your 4 hour cycle...

Edit2 - Looks like this picture below.

cSwUw6l.jpg

 

Link to comment
Share on other sites

  • 0

Hello,

 

Below is my working code from custom debug monitor (taken from posts in forums & modified little bit) which you might re-use.

 

I don't know how your current debug mon works but the down side of the one I copied below is:

1) it is not on/off toggleable by the player (it stays on all the time) and

2) it does not show vehicle/weapon picture or name.

 

I will try and improve it with the above, if you're interested I can share with you the working code when it's ready...

<snip>

The improved version is shared 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Discord

×
×
  • Create New...