Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- TITLE DayZ SA Server - Status
- COLOR 0A
- :: DEFINE the following variables where applicable to your install
- SET SteamLogin=anonymous
- SET DayZBranch=223350
- SET DayZServerPath="C:\DZServer"
- SET SteamCMDPath="C:\steamcmd"
- SET BECPath="C:\BEC"
- :: DayZ Mod Parameters
- set DayZModList=(C:\DZServer\Modlist.txt)
- set SteamCMDWorkshopPath="C:\steamcmd\steamapps\workshop\content\221100"
- set SteamCMDDelay=5
- setlocal EnableDelayedExpansion
- :: _______________________________________________________________
- goto checkServer
- pause
- :checkServer
- tasklist /fi "imagename eq DayZServer_x64.exe" 2>NUL | find /i /n "DayZServer_x64.exe">NUL
- if "%ERRORLEVEL%"=="0" goto checkBEC
- cls
- echo El servidor no se está ejecutando, chekeando...
- goto killServer
- :checkBEC
- tasklist /fi "imagename eq BEC.exe" 2>NUL | find /i /n "BEC.exe">NUL
- if "%ERRORLEVEL%"=="0" goto loopServer
- cls
- echo Bec no se está ejecutando, chekeando...
- goto startBEC
- :loopServer
- FOR /L %%s IN (30,-1,0) DO (
- cls
- echo Servidor activo, chekeando en %%s segundos..
- timeout 1 >nul
- )
- goto checkServer
- :killServer
- taskkill /f /im Bec.exe
- taskkill /f /im DayZServer_x64.exe
- taskkill /f /im DZSALModServer.exe
- goto updateServer
- :updateServer
- cls
- echo Actualizando Servidor.
- timeout 1 >nul
- cls
- echo Actualizando Servidor..
- timeout 1 >nul
- cls
- echo Actualizando Servidor...
- cd "%SteamCMDPath%"
- steamcmd.exe +login %SteamLogin% +force_install_dir %DayZServerPath% +"app_update %DayZBranch%" +quit
- goto updateMods
- :startServer
- cls
- echo Iniciando Servidor.
- timeout 1 >nul
- cls
- echo Iniciando Servidor..
- timeout 1 >nul
- cls
- echo Iniciando Servidor...
- cd "%DayZServerPath%"
- start DayZServer_x64.exe -instanceId=1 -config=serverDZ.cfg -profiles=ServerProfiles -port=2302 -bepath=C:\DZServer\battleye -mod=!MODS_TO_LOAD!% -cpuCount=4 -noFilePatching -dologs -adminlog -freezecheck
- FOR /l %%s IN (45,-1,0) DO (
- cls
- echo Iniciando Servidor, espere %%s segundos para iniciar BEC..
- timeout 1 >nul
- )
- goto startBEC
- :startBEC
- cls
- echo Iniciando BEC.
- timeout 1 >nul
- cls
- echo Iniciando BEC..
- timeout 1 >nul
- cls
- echo Iniciando BEC...
- timeout 1 >nul
- cd "%BECPath%"
- start Bec.exe -f Config.cfg --dsc
- goto checkServer
- :updateMods
- cls
- FOR /L %%s IN (%SteamCMDDelay%,-1,0) DO (
- cls
- echo Chekeando actualizaciones en %%s segundos..
- timeout 1 >nul
- )
- echo Actualizando Mods...
- @ timeout 1 >nul
- cd %SteamCMDPath%
- for /f "tokens=1,2 delims=," %%g in %DayZModList% do steamcmd.exe +login %SteamLogin% +workshop_download_item 221100 "%%g" +quit
- cls
- echo Mods actualizados, sincronizando datos con el servidor...
- @ timeout 2 >nul
- cls
- @ for /f "tokens=1,2 delims=," %%g in %DayZModList% do robocopy "%SteamCMDWorkshopPath%\%%g" "%DayZServerPath%\%%h" *.* /mir
- @ for /f "tokens=1,2 delims=," %%g in %DayZModList% do forfiles /p "%DayZServerPath%\%%h" /m *.bikey /s /c "cmd /c copy @path %DayZServerPath%\keys"
- cls
- echo Sincronizacion completa!
- @ timeout 3 >nul
- cls
- set "MODS_TO_LOAD="
- for /f "tokens=1,2 delims=," %%g in %DayZModList% do (
- set "MODS_TO_LOAD=!MODS_TO_LOAD!%%h;"
- )
- set "MODS_TO_LOAD=!MODS_TO_LOAD:~0,-1!"
- ECHO Cargando mods: !MODS_TO_LOAD!%
- @ timeout 3 >nul
- goto startServer
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement