Skip to content

Instantly share code, notes, and snippets.

@Mirv
Last active July 19, 2020 13:24
Show Gist options
  • Save Mirv/a90a135bb993e425ae622990ead5bba6 to your computer and use it in GitHub Desktop.
Save Mirv/a90a135bb993e425ae622990ead5bba6 to your computer and use it in GitHub Desktop.
arma3 batch file for dedicated server
rem "How to Setup Headless Client on Arma 3"
rem From "Last Resort Gaming"
rem https://www.youtube.com/watch?v=UQfMhFfs5yQ
rem "%ArmaServer% is my environmental variable to hold the location of the config file"
echo "Env var ArmaServer..."
echo %ArmaServer%
rem "This requires that count_tests.txt file exists in same spot as the batch file & holds ONLY an integer greater than -1"
rem "This will read the count_tests.txt & add on"
set /p a=< count_tests.txt
echo %texte%
rem "Adding requires the /a param"
@set /a "c=%a%+1"
rem "Save the newly incremented count to the file"
echo %c%>count_tests.txt
rem "Remove this if you don't want to see the vars before executing the server script"
Pause
mode con: cols=60 lines=10
rem@echo off
FOR /F "tokens=* delims=" %%x in (new.txt) DO echo %%x
start /min "" "C:\Program Files (x86)\Steam\steamapps\common\Arma 3 Server\arma3server_x64.exe" ^
-profiles="C:\Program Files (x86)\Steam\steamapps\common\Arma 3 Server\Profiles" ^
-config="C:\Program Files (x86)\Steam\steamapps\common\Arma 3 Server\myDedicated\JPS tests\Dedicated - Antistasi\TADST_config.cfg" ^
-connect=127.0.0.1 ^
-port=2302 ^
-password=""^
-Mod="" ^
-name="Test Dedicated server" ^
Exit
rem "This one is not working - had to get back on task after 20 min of making the first one & spending like 10 more on this ... "
rem "How to Setup Headless Client on Arma 3"
rem From "Last Resort Gaming"
rem https://www.youtube.com/watch?v=UQfMhFfs5yQ
rem "%ArmaServer% is my environmental variable to hold the location of the config file"
echo "Env var ArmaServer..."
echo %ArmaServer%
set config_file=%ArmaServer%
echo "config_file ..."
echo config_file
rem "--- Begin count of tests ran ---"
rem "--- Begin count of tests ran ---"
if exists count_tests.txt (
rem "This will read the count_tests.txt in to a"
set /p a=< count_tests.txt
rem "This will loop thru allowed values aka numbers"
SET "var="&for /f "delims=0123456789" %%i in ("%1") do set var=%%i
if defined var (
echo %a NOT numeric
) else (
rem "If it's a number, we add one to the count & save to variable c"
@set /a "c=%a%+1"
)
) else (
set c=1
)
rem "This over writes the file with new value of
echo %c%>count_tests.txt
rem "--- End count of tests ran ---"
rem "--- End count of tests ran ---"
Pause
rem "This is the Last Resorts script here, with some minor adjustments by me"
mode con: cols=60 lines=10
FOR /F "tokens=* delims=" %%x in (new.txt) DO echo %%x
start /min "" "C:\Program Files (x86)\Steam\steamapps\common\Arma 3 Server\arma3server_x64.exe" ^
-profiles="C:\Program Files (x86)\Steam\steamapps\common\Arma 3 Server\Profiles" ^
-config="C:\Program Files (x86)\Steam\steamapps\common\Arma 3 Server\myDedicated\JPS tests\Dedicated - Antistasi\TADST_config.cfg" ^
-connect=127.0.0.1 ^
-port=2302 ^
-password=""^
-Mod="" ^
-name="Test Dedicated server" ^
Exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment