2
setlocal EnableDelayedExpansion
4
:: Check for admin privileges
7
echo Running as administrator.
9
echo Not running as administrator. Trying to elevate...
13
:: If the script has admin rights, continue with the rest of the script
17
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
18
echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
25
set OPENVPN_PATH="C:\Program Files\OpenVPN\bin\openvpn.exe"
27
set CONNECTING_TO_VPN=0
32
echo ------------------ LOOP WRAP ------------------
33
for /L %%i in (1,1,20) do echo. REM adds 20 blank lines
37
tasklist /FI "IMAGENAME eq armagetronad.exe" 2>NUL | find /I /N "armagetronad.exe">NUL
38
if "%ERRORLEVEL%"=="0" (
39
echo Armagetronad is running.
41
echo Armagetronad is not running.
46
timeout /t 5 /nobreak > NUL
51
echo. > "C:\Users\itsne\Desktop\arma_chatbot_config\openvpn.log"
52
taskkill /F /FI "WINDOWTITLE eq OpenVPNConnection" 2>NUL
53
set CONNECTING_TO_VPN=1
55
taskkill /F /IM openvpn.exe 2>NUL
58
set OVPN_DIR=C:\Users\itsne\Desktop\arma_chatbot_config\VPN\OVPN
60
for %%f in (%OVPN_DIR%\*.ovpn) do (
62
set "file[!count!]=%%f"
65
set /a "randIndex=(%random% %% count) + 1"
66
set "randFile=!file[%randIndex%]!"
68
echo Using VPN configuration file: !randFile!
70
start "OpenVPNConnection" cmd /c "%OPENVPN_PATH% --config "!randFile!" > "C:\Users\itsne\Desktop\arma_chatbot_config\openvpn.log" 2>&1"
72
REM wait for VPN to connect
74
for /L %%x in (1,1,6) do ( REM try for up to 6 times with a 5 sec interval to 30 seconds
76
findstr /C:"Initialization Sequence Completed" "C:\Users\itsne\Desktop\arma_chatbot_config\openvpn.log" > NUL
77
if !errorlevel! == 0 (
81
REM check for auth fail
82
findstr /C:"AUTH: Received control message: AUTH_FAILED" "C:\Users\itsne\Desktop\arma_chatbot_config\openvpn.log" > NUL
83
if !errorlevel! == 0 (
84
echo Authentication failure detected. Retrying...
85
taskkill /F /FI "WINDOWTITLE eq OpenVPNConnection" 2>NUL
86
taskkill /F /IM openvpn.exe 2>NUL
93
if !VPN_CONNECTED! == 0 (
94
echo VPN connection failed or took too long.
97
set CONNECTING_TO_VPN=0
102
if "%CONNECTING_TO_VPN%"=="1" (
106
for /f "tokens=2 delims=: " %%i in ('curl -s https://httpbin.org/ip') do (
110
ECHO COMPARING %CURRENT_IP% VS %REAL_IP%
111
if "%CURRENT_IP%"=="%REAL_IP%" (
112
echo Not connected to a VPN. Connecting...
115
echo Connected to a VPN. (%CURRENT_IP%)
121
echo Checking if banned..
122
copy /Y "C:\Users\itsne\AppData\Roaming\Armagetron\var\banned.txt" "C:\temp\banned_copy.txt" >NUL 2>&1
123
for /f %%i in (C:\temp\banned_copy.txt) do (
124
echo Banned! Changing IP...
131
echo Killing old process if any
132
taskkill /F /IM "armagetronad.exe" 2>NUL
134
REM NETWORK LOC ACCESSABLE?
135
pushd "\\tsclient\C\" 2>NUL
137
echo The network location is not accessible!
143
echo Deleting old dist folder
144
rmdir /s /q "C:\Users\itsne\Desktop\dist" 2>NUL
146
echo Copying new dist folder
147
xcopy "\\tsclient\C\Games\ArmagetronProject2.0\dist" "C:\Users\itsne\Desktop\dist" /E /I /Y
150
for /f "delims=" %%a in ('wmic OS Get localdatetime ^| find "."') do set datetime=%%a
151
set timestamp=%datetime:~0,4%-%datetime:~4,2%-%datetime:~6,2%-%datetime:~8,2%%datetime:~10,2%%datetime:~12,2%
154
call :GenerateTimestamp
156
echo Creating backup of stats.db...
157
copy "C:\Users\itsne\AppData\Roaming\Armagetron\var\stats.db" "C:\Users\itsne\Desktop\arma_chatbot_config\Backups\stats-%timestamp%.db"
160
echo Running new Armagetronad
161
start "" "C:\Users\itsne\Desktop\dist\armagetronad.exe"
b'\\ No newline at end of file'