China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-06-22 00:56
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » How to represent a progress status with "\-/"? DigestI View 24,454 Replies 57
Floor 16 Posted 2006-10-31 01:52 ·  中国 上海 华为云
初级用户
Credits 32
Posts 9
Joined 2006-10-30 15:04
19-year member
UID 68888
Gender Male
Status Offline
The effect made by redtek is exactly what I wanted to say, thanks.
Floor 17 Posted 2006-10-31 02:02 ·  中国 北京 东城区 联通
金牌会员
★★★★
Credits 2,902
Posts 1,147
Joined 2006-09-21 12:00
19-year member
UID 63324
Gender Male
Status Offline
Don't thank me. A fun animation can't be realized without every participant:)

It was kawakumo who inspired a fun title and the idea of making an animation;
The code of youxi01 and the code of moderator qwe1234567 and a backspace application;
9527 discovered the problem of the backspace character when COPY CON,
And the super VBS skills of moderator 3742668,
With each of our participation and communication, the forum content will be more and more rich:)

[ Last edited by redtek on 2006-10-31 at 02:09 AM ]
    Redtek,一个永远在网上流浪的人……

_.,-*~'`^`'~*-,.__.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._
Floor 18 Posted 2006-10-31 02:06 ·  中国 北京 东城区 联通
金牌会员
★★★★
Credits 2,902
Posts 1,147
Joined 2006-09-21 12:00
19-year member
UID 63324
Gender Male
Status Offline
Originally posted by 9527 at 2006-10-31 01:58:
Still the same sentence---it's all my fault, I shouldn't have drawn conclusions so early...


If you don't COPY CON...
You won't even find that the backspace character was actually converted in real time when COPY con was used : )
Because everyone's participation will always play a role in promoting and discovering updated knowledge ~ : )
    Redtek,一个永远在网上流浪的人……

_.,-*~'`^`'~*-,.__.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._
Floor 19 Posted 2006-10-31 02:10 ·  中国 上海 华为云
初级用户
Credits 32
Posts 9
Joined 2006-10-30 15:04
19-year member
UID 68888
Gender Male
Status Offline
After several tests, this is a relatively nice effect

@echo off
setlocal enabledelayedexpansion
set b=/--\--
set 速度=0.8
set 退格=
:b
for /l %%i in (0,1,200) do call :a %%i
goto :b
:a
set/a a=%1%%4
set/p=!b:~%a%,1!<nul
ping/n %速度% 127.1>nul
set/p=%退格%<nul
goto :eof
Recent Ratings for This Post ( 1 in total) Click for details
RaterScoreTime
redtek +2 2006-10-31 02:37
Floor 20 Posted 2006-10-31 04:21 ·  中国 上海 华为云
初级用户
Credits 32
Posts 9
Joined 2006-10-30 15:04
19-year member
UID 68888
Gender Male
Status Offline
I don't know how to implement the effects of youxi01 and redtek in the same line.

[ Last edited by kawakumo on 2006-10-31 at 04:22 AM ]
Floor 21 Posted 2006-10-31 05:28 ·  中国 北京 朝阳区 联通
金牌会员
★★★★
Credits 2,902
Posts 1,147
Joined 2006-09-21 12:00
19-year member
UID 63324
Gender Male
Status Offline
Originally posted by kawakumo at 2006-10-31 04:21:
I don't know how to implement the effects of youxi01 and redtek in the same line?

[ Last edited by kawakumo on 2006-10-31 at 04:22 AM ]


Appropriate application of prohibiting backspace will make the displayed characters "move forward" ~ : )

The following is a very wonderful post! It can't be allowed to sink ~ : )
It talks about very detailed principles and enjoyable content ~ : )



   Brief Analysis of Helpless Signature Code
  http://www.cn-dos.net/forum/viewthread.php?tid=18838&fpage=1&highlight=%E6%97%A0%E5%A5%88%E4%BD%95
    Redtek,一个永远在网上流浪的人……

_.,-*~'`^`'~*-,.__.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._
Floor 22 Posted 2006-10-31 05:50 ·  中国 广东 清远 联通
高级用户
★★
Credits 846
Posts 247
Joined 2006-10-27 12:03
19-year member
UID 68504
Gender Male
From 湖南==》广东
Status Offline
This may be the code you need:
@echo off
rem qwe1234567 character animation

setlocal enabledelayedexpansion
set b=\^|/-
set 速度=2

rem The ASCII code 08 is the backspace special control character
set 退格=

:b
for /l %%i in (0,1,3) do call :a %%i
cls
goto :b
:a
set /a num=%1+1
set/p test=!b:~%1,1!!b:~0,%num%!<nul
ping/n %速度% 127.1>nul
set/p=%退格%<nul
goto :eof
Recent Ratings for This Post ( 1 in total) Click for details
RaterScoreTime
redtek +2 2006-10-31 06:34
Floor 23 Posted 2006-10-31 14:03 ·  中国 上海 华为云
初级用户
Credits 32
Posts 9
Joined 2006-10-30 15:04
19-year member
UID 68888
Gender Male
Status Offline
No, what I want to say is as follows:
[Use * to represent the rolling \- /]
.*
..*
...*
....*
.....*
......*
.......*
Each time adding a dot is the effect of youxi01, and the rolling * is the effect of redtek, implemented in the same line.
Floor 24 Posted 2006-11-01 00:27 ·  中国 福建 泉州 电信
银牌会员
★★★
Credits 1,276
Posts 469
Joined 2002-12-23 13:00
23-year member
UID 586
Gender Male
From 福建泉州
Status Offline
I also post one. I don't know if this meets the requirements of the person above.

@echo off
setlocal enabledelayedexpansion
set b=/-\ /-\ **
set 速度=1
set 退格=
:b
for /l %%i in (0,1,200) do call :a %%i
goto :b
:a
set/a a=%1%%10
set/a c=%a%%%4
if %a% EQU 0 set/p=.<nul
if %c% EQU 3 (set/p=^|<nul) else (set/p=!b:~%a%,1!<nul)
ping/n %速度% 127.1>nul
set/p=%退格%<nul
goto :eof
Recent Ratings for This Post ( 2 in total) Click for details
RaterScoreTime
redtek +2 2006-11-01 00:34
tireless +8 2008-09-10 10:35
QQ:366840202
http://chenall.net
Floor 25 Posted 2006-11-01 00:34 ·  中国 北京 东城区 联通
金牌会员
★★★★
Credits 2,902
Posts 1,147
Joined 2006-09-21 12:00
19-year member
UID 63324
Gender Male
Status Offline
Haha... It's really fun to make~ : )
    Redtek,一个永远在网上流浪的人……

_.,-*~'`^`'~*-,.__.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._
Floor 26 Posted 2006-11-01 02:29 ·  中国 浙江 温州 电信
初级用户
★★
Credits 154
Posts 67
Joined 2006-10-31 00:50
19-year member
UID 68933
Gender Male
Status Offline
Benefited a lot.
Although this method can create an "animation effect", the disadvantages are also obvious.
That is, the control of speed cannot be more accurately grasped.
Floor 27 Posted 2006-11-01 09:19 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
19-year member
UID 59080
Status Offline

To precisely control the speed, that is, to achieve delay, you can use third-party command-line tools.

Here is a recommended small tool called sleepx, which can be precise to ms, that is, precise to milliseconds.
Attachments
SleepX.rar (18.89 KiB, Credits to download 1 pts, Downloads: 60)
Floor 28 Posted 2006-11-01 13:54 ·  中国 上海 华为云
初级用户
Credits 32
Posts 9
Joined 2006-10-30 15:04
19-year member
UID 68888
Gender Male
Status Offline
That's good, it's exactly the effect made by chenall, really amazing.
Floor 29 Posted 2006-11-01 13:58 ·  中国 上海 华为云
初级用户
Credits 32
Posts 9
Joined 2006-10-30 15:04
19-year member
UID 68888
Gender Male
Status Offline
If you want to use this effect to represent progress, how to control it? For example, display the progress of copying files.
Floor 30 Posted 2006-11-01 14:03 ·  中国 上海 华为云
初级用户
Credits 32
Posts 9
Joined 2006-10-30 15:04
19-year member
UID 68888
Gender Male
Status Offline
Change "set b=/-\ /-\ " to "set b=./-\ /-\ ". Adding a dot makes the effect better when wrapping lines.
Forum Jump: