编译】D43_动态图-兔斯基-进度条.bat
@echo off
mode con cols=54 lines=20
color f0
set /a D43_app.firstPrint=0
set /a D43_app.size=19
set /a D43_app.lastPrint=0
set /a D43_app.blanklines=13
set /a D43_app.spaceCounts=6
set /a D43_app.addLength=20
set /a D43_app.cur=0
set /a D43_app.typeMode=0
set /a D43_app.pcitureCount=0
set D43_app.count=
set D43_app.loadPicture=
set D43_app.pictureTag=::tuSiJi
set D43_app.length=
set D43_app.tmp=
set D43_app.arr=
set /a D43_app.show.total=1
set /a D43_app.show.finish=0
set /a D43_app.show.totalLength=17
set /a D43_app.show.finishLength=0
set /a D43_app.show.rate=0
for /f "usebackq tokens=* delims=" %%i in ("%~0") do (
if "%%~i"=="%D43_app.pictureTag%_end" goto :D43_finishCount
if defined D43_app.count (
call :D43_addCount
)
if "%%~i"=="%D43_app.pictureTag%" set D43_app.count=on
)
:D43_finishCount
set /a D43_app.show.total=%D43_app.pictureCount%+0
echo 正在加载图片...
for /f "usebackq tokens=* delims=" %%i in ("%~0") do (
if "%%~i"=="%D43_app.pictureTag%_end" goto :D43_finishLoad
if defined D43_app.loadPicture (
set D43_app.tmp=%%i
call :D43_setArr
call :D43_showRate
)
if "%%~i"=="%D43_app.pictureTag%" set D43_app.loadPicture=on
)
:D43_finishLoad
set /a D43_app.length=%D43_app.cur%-1
ping -n 2 127.0.0.1 >nul
setlocal EnableDelayedExpansion
:D43_next
cls
set /a D43_app.lastPrint=%D43_app.firstPrint%+%D43_app.size%
for /l %%i in (1,1,%D43_app.blanklines%) do (
echo a
)
if "%D43_app.typeMode%"=="1" (
type D43_tmp.txt
>D43_tmp.txt echo.
)
for /l %%i in (%D43_app.firstPrint%,1,%D43_app.lastPrint%) do (
call :D43_print %%i
)
if %D43_app.firstPrint% GEQ %D43_app.length% (
set /a D43_app.firstPrint= 0
) else (
set /a D43_app.firstPrint=%D43_app.firstPrint% + %D43_app.addLength%
)
call :D43_sleep
goto :D43_next
endlocal
exit
::一层c
::函数1
:D43_setArr
call :a20 D43_app.tmp D43_app.arr[%D43_app.cur%]
set /a D43_app.cur=%D43_app.cur%+1
goto :eof
:D43_print
if %1 GTR %D43_app.length% (
set /a index=%1-%D43_app.length%
) else (
set /a index=%1
)
if "%D43_app.typeMode%"=="1" (
>> D43_tmp.txt echo a !D43_app.arr[%index%].truevalue!
) else (
echo a !D43_app.arr[%index%].truevalue!
)
goto :eof
:D43_printByIndex
echo %~1
goto :eof
:D43_sleep
for /l %%i in (0,1,35) do (
for /l %%j in (0,1,55) do (
set b=%%i
)
)
goto :eof
:D43_addCount
set /a D43_app.pictureCount=%D43_app.pictureCount%+1
goto :eof
:D43_showRate
set /p="[" <nul
set /a D43_app.show.finish=%D43_app.show.finish%+1
set /a D43_app.show.finishLength=%D43_app.show.totalLength% * %D43_app.show.finish%/%D43_app.show.total%
for /l %%j in (0,1,%D43_app.show.totalLength%) do (
if %%j leq %D43_app.show.finishLength% (
set /p="■" <nul
) else (
set /p="▂