Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- :: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- :: :::: S T A R T S E R V E R . B A T ::::
- :: :::: CONTACT INFO: RSCORPIO64@GMAIL.COM ::::
- :: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- title Minecraft Server Starter
- :: NEED ABSOLUTE PATH TO MINECRAFT SERVER
- c:
- cd "\mcserver\"
- :: LOAD UP THE BATCH FILE
- :: start /min "SERVER_BACKUP" backup.bat
- :LOAD_SERVER
- cls
- echo.
- echo " _____ ___________________ _____ _____________________"
- echo " / \ \_ ___ \______ \ / _ \\_ _____|__ ___/"
- echo " / \ / \ ______ / \ \/| _/ / /_\ \| __) | | "
- echo "/ Y \ /_____/ \ \___| | \/ | \ \ | | "
- echo "\____|__ / \______ /____|_ /\____|__ |___ / |____| "
- echo " \/ \/ \/ \/ \/ "
- echo " ________________________________ _______________________ "
- echo " / _____|_ _____|______ \ \ / |_ _____|______ \ "
- echo " \_____ \ | __)_ | _/\ Y / | __)_ | _/ "
- echo " / \| \| | \ \ / | \| | \ "
- echo "/_______ /_______ /|____|_ / \___/ /_______ /|____|_ / "
- echo " \/ \/ \/ \/ \/ "
- echo "__________ ____ __________ _______ .___ _______ ________ "
- echo "\______ \ | \ \ \ \ | |\ \ / _____/ "
- echo " | _/ | / | \ / | \| |/ | \/ \ ___ "
- echo " | | \ | / | \/ | \ / | \ \_\ \ "
- echo " |____|_ /______/\____|__ /\____|__ /___\____|__ /\______ / "
- echo.
- :: next line optional for title display
- timeout /t 2
- :: GET LATEST SERVER ON EACH LOAD
- del server.jar /Q
- :: CURL manditory to work
- :: https://www.mediafire.com/file/a2tpm3u28k233qt/curl-7.64.1.7z/file
- echo.
- echo Checking for latest MINECRAFT version
- echo ------------------------------------------
- curl -O https://piston-data.mojang.com/v1/objects/c9df48efed58511cdd0213c56b9013a7b5c9ac1f/server.jar
- echo.
- echo.
- echo.
- echo STARTING SERVER
- echo.
- echo.
- :: LOAD YOUR SERVER HERE
- :: ## CHANGE MEMORY REQUIREMENTS HERE AS DESIRED
- start /b /wait "MINECRAFT RESTARTER" java.exe -Xmx4G -Xms4G -jar server.jar nogui
- echo.
- :: SYSTEM COMES HERE WHEN THE SERVER STOPS
- :: WHAT WE DO HERE IS DO A TIME OUT INCASE THE EXIT WAS INTENTIONAL,
- :: IF NOT IT WILL BE TREATED AS A CRASH
- :: ALLOW 10 SECOND DELAY,
- echo Server stoppped!! Server will reload in 10 seconds,
- echo PRESS ANY KEY TO EXIT SERVER
- call :controlTimeout 15
- if errorlevel 1 (
- GOTO EXIT_SERVER
- ) else (
- GOTO CRASH
- )
- exit /b
- :controlTimeout
- :: TIMEOUT IS A BUILT IN WINDOWS FEATURE
- setlocal
- start "" /belownormal /b cmd /q /d /c "timeout.exe %~1 /nobreak > nul"
- timeout.exe %~1 & tasklist | find "timeout" >nul
- if errorlevel 1 ( set "exitCode=0" ) else (
- set "exitCode=1"
- taskkill /f /im timeout.exe 2>nul >nul
- )
- endlocal & exit /b %exitCode%
- :CRASH
- :: ADD TO LOG HERE IF CTRL-X WAS NOT PRESED
- set this_date = date /t
- echo Server Crashed on !this_date! >> crash.log
- :: IF NOT, IT MUST HAVE BEEN A CRASH, RELOAD THE SERVER
- GOTO LOAD_SERVER
- :EXIT_SERVER
- del /q server.up
- exit 0
Add Comment
Please, Sign In to add comment