Hey guys, I don't know if this has been released before, but as far as I know the last working one was like for 317 or something, this works for all revisions and is a bat file.
THIS ONLY WORKS FOR SERVERS WITH JAVA CONTROL PANELS!
First off, create a notepad file, and open it. THIS FILE MUST BE IN THE SAME FILE AS THE BAT FILE USED TO RUN YOUR SERVER!
Next, you will need to put this inside of it :
Code:
@echo off
REM created by Kidoncoke
title Server Automated Restarter and Crash Detector
:start
set time=14400
ping 127.0.0.1 -n 2 > NUL
start run.bat
:loop
cls
IF %time% GTR 0 (
set /a time=%time% - 1
set /a min=%time%/60
echo Next Restart In %time% Seconds or %min% Minutes.
ping 127.0.0.1 -n 2 > NUL
tasklist /FI "IMAGENAME eq java.exe" 2>NUL | find /I /N "java.exe" >NUL
if "%ERRORLEVEL%"=="0" goto loop
goto start
)
taskkill /f /im java.exe
cls
goto start
You will need to change the "start run.bat" to the name of the bat file that launches your server, for example, "start runserver.bat".
By default, this will restart the server every 4 hours, and if the server goes down for any reason, it will start it back up. The 4 hour restart is so that Jad killers and such wont get pissed off.
You will then need to go to file>save as>and then put a file name of your choice, with .bat on the end, for example, "autorestarter.bat". You will also have to change the file extension to "All" or something along those lines.
You are now done, launch it to see if it works, and dont forget to drop a thanks.