:fixer_menu @ECHO OFF net session >nul 2>&1 Title Fixer rem Define variables set…
- User
:fixer_menu
@ECHO OFF net session >nul 2>&1
Title Fixer rem Define variables set "ruleName=hola" set "softwareName=AndroidEmulatorEn" set "executablePath=" set "lastStatus="
rem Check for GameLoop installation path in the registry FOR /F "usebackq tokens=2*" %%I IN (reg query "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Tencent\MobileGamePC\UI" /v InstallPath) DO ( SET "InstallPath=%%J" )
rem Set the executable path directly set "executablePath=%InstallPath%\AndroidEmulatorEn.exe"
:check_firewall rem Check if the firewall is enabled netsh advfirewall show allprofiles state | find "State" | find "ON" >nul if %errorlevel% neq 0 ( cls echo Windows Firewall is disabled. Please enable the firewall to use this fixer. pause goto fixer_menu )
:display_menu cls echo............................................................................................................. echo BGMI FIXER echo............................................................................................................. echo.
call :check_rule_status call :display_status echo. echo Select an option: echo 1. Start Fixer [ALT + F] echo 2. Stop Fixer [ALT + G] echo 3. No match found fix [ALT + H] echo 4. Ignore this option echo 5. Go back to main menu
:wait_for_input rem Wait for user input or check status every second choice /C 12345 /N /T 1 /D 4 >nul if errorlevel 5 ( goto menu ) if errorlevel 4 ( call :check_rule_status if "!currentStatus!" neq "!lastStatus!" ( goto display_menu ) goto wait_for_input ) if errorlevel 3 ( call :no_match_fix goto display_menu ) if errorlevel 2 ( call :stop_fixer goto display_menu ) if errorlevel 1 ( call :start_fixer goto display_menu ) goto wait_for_input
:check_rule_status netsh advfirewall firewall show rule name="%ruleName%" >nul 2>&1 if %errorlevel% equ 0 ( set "currentStatus=on" ) else ( set "currentStatus=off" ) exit /b
:display_status rem Set color and display current status if "%currentStatus%"=="on" ( color 2F echo Current Status : Fixer on ) else ( color 4F echo Current Status : Fixer off ) set "lastStatus=%currentStatus%" exit /b
:start_fixer echo Starting Fixer.. netsh advfirewall firewall add rule name="%ruleName%" protocol=TCP remoteport=80-17500 dir=out action=block program="%executablePath%" powershell -c "[console]::beep(1500,500)" >nul 2>&1 powershell -c "[console]::beep(1500,500)" >nul 2>&1 exit /b
:stop_fixer echo Stopping Fixer.... netsh advfirewall firewall delete rule name="%ruleName%" >nul 2>&1 powershell -c "[console]::beep(500,1000)" >nul 2>&1 exit /b
:no_match_fix echo Fixing... rem Allow outgoing TCP traffic on specific ports and block other outgoing traffic for the application in one go netsh advfirewall firewall add rule name="allow_block_tcp" protocol=TCP dir=out action=allow remoteport=17500,8080,443 program="%executablePath%" netsh advfirewall firewall add rule name="block_tcp" protocol=TCP dir=out action=block program="%executablePath%"
- Assistant
To achieve the desired behavior for the
stop_fixerfunction, where it gives a beep first, deletes the rule, and then gives another beep if any traffic is detected on port 17500 forAndroidEmulatorEn.exe, you'll need to modify the script and introduce a check for traffic on the specified port. Unfortunately, batch scripting does not have built-in capabilities to directly monitor network traffic on specific ports. However, we can utilize workarounds or external tools such as PowerShell to achieve similar behavior. Here's an improved version of the function: - User
it showed a error in red and closed abruptly after turning off rule
- Assistant
The error you're experiencing could be due to a few possible issues, such as incorrect permissions, missing modules, or syntax errors. Let's revise the function to ensure it runs more smoothly and gracefully handles situations where the process or network connections are not found.
- User
again same , error was something like missing
- Assistant
- User
it showed executable path and then closed abruptly
- Assistant
- User
again same
- Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.