I set up a CS server just for fun. Since mine is a dynamic IP, and adding SXE requires modifying the IP parameter, I made a P to do it:
What I wanted was to import only when "Y" is entered, but right now only pressing Enter directly exits; pressing any key will import it. So where exactly is the mistake?
@echo off
set /p lip=<lip.txt
del ips.asp 1>nul 2>&1
wget http://www.ip138.com/ips.asp 1>nul 2>&1
for /f "tokens=2 skip=2 delims=" %%i in ('find "您的IP地址是:" ips.asp') do set "ip=%%i"
del ips.asp 1>nul 2>&1
echo Last imported IP was: %lip%
echo Current public IP is: %ip%
if %lip%==%ip% echo The two are the same!
set /p cf=Need to import it? Press Y to confirm, anything else to quit:
if %cf%=="y" goto :cip || goto :eof
:cip
echo.
echo Importing, please wait...
U82GB.vbs "server.cfg"
for /f "delims=" %%j in (server.cfg) do (
echo.%%j | findstr/i "__sxei_internal_ip">nul && echo __sxei_internal_ip %ip%||echo %%j
)>>sv.tmp
move sv.tmp server.cfg
GB2U8.vbs "server.cfg"
echo.%ip%>lip.txt
cls&echo Successfully imported %ip%!
pauseWhat I wanted was to import only when "Y" is entered, but right now only pressing Enter directly exits; pressing any key will import it. So where exactly is the mistake?

]>