goto + timeout 即可实现- @echo off & cd /d "%~dp0"
- set "foot=.changemap"
- set "file=server.properties"
- if not exist "logs\latest.txt" goto :exit
- REM 时间间隔(秒)
- set "times=30"
- :loop
- call :updateProfile
- timeout /t %times% /nobreak
- goto :loop
- :exit
- pause&exit
-
- :updateProfile
- echo.
- for /f "delims=." %%i in ('findstr /i "%foot%" "logs\latest.txt"') do (
- set "level-name=%%i"
- set "resourcepack=https:网盘地址/%%i.zip"
- )
- (
- for /f "usebackq tokens=1* delims==" %%i in ("%file%") do (
- if /i "%%i"=="level-name" echo %%i=%level-name%
- if /i "%%i"=="resourcepack" echo %%i=%resourcepack%
- if /i not "%%i"=="level-name" if /i not "%%i"=="resourcepack" echo %%i=%%j
- )
- ) > "%file%_NEW"
- move /y "%file%_NEW" "%file%"
- start "" "stop.bat"
- echo say mapchangecomplete!
- goto :eof
复制代码
|