Загрузка данных


@echo off
setlocal EnableExtensions

REM ==================================================
REM Half-Life Speedrun Launcher - Windows 7 Clean BAT
REM Fullscreen enabled - No PowerShell required
REM ==================================================

REM --- Configuration ---
set "FREQ=100"
set "HL_GAME=valve_WON"

set "ROOT=%~dp0"
set "HL_DIR=%ROOT%Half-Life"
set "BXT=%ROOT%Bunnymod XT\Injector.exe"
set "RINPUT=%ROOT%RInput\RInput.exe"

REM --- Bunnymod XT: disable VSync ---
set "BXT_DISABLE_VSYNC=1"

REM --- Set Windows power plan to High Performance ---
powercfg -setactive SCHEME_MIN >nul 2>&1

REM --- File checks ---
if not exist "%HL_DIR%\hl.exe" (
    echo [ERROR] hl.exe was not found in "%HL_DIR%"
    pause
    exit /b 1
)

if not exist "%BXT%" (
    echo [ERROR] Bunnymod XT Injector was not found in "%BXT%"
    pause
    exit /b 1
)

if not exist "%RINPUT%" (
    echo [ERROR] RInput was not found in "%RINPUT%"
    pause
    exit /b 1
)

REM --- Half-Life launch arguments ---
REM -full forces fullscreen mode.
REM Remove -steam if this is not the Steam version.
REM Change FREQ if the monitor is not actually running at 100Hz.
set "HL_ARGS=-steam -gl -32bpp -full -game %HL_GAME% -noforcemparms -noforcemaccel -noforcemspd -nojoy -nofbo -nomsaa -freq %FREQ%"

echo [INFO] Launching Half-Life with Bunnymod XT in fullscreen...
start "" /D "%HL_DIR%" "%BXT%" hl.exe %HL_ARGS%

REM --- Wait until hl.exe is running ---
echo [INFO] Waiting for hl.exe...
for /l %%i in (1,1,15) do (
    tasklist /FI "IMAGENAME eq hl.exe" 2>NUL | find /I "hl.exe" >NUL && goto HL_FOUND
    timeout /t 1 /nobreak >nul
)

echo [ERROR] hl.exe was not detected after 15 seconds.
pause
exit /b 1

:HL_FOUND
echo [INFO] hl.exe detected.

REM Give the game a short moment to finish initializing
timeout /t 2 /nobreak >nul

REM --- Start RInput ---
echo [INFO] Starting RInput...
start "" "%RINPUT%" hl.exe

REM --- Set Half-Life priority ---
REM 128 = High priority
REM 32768 = Above Normal, safer if High causes stutters
echo [INFO] Setting hl.exe priority to High...
wmic process where name="hl.exe" CALL setpriority 128 >nul 2>&1

echo [OK] Launch complete.
exit /b 0