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 23:50
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » [Original] COLOR TIME Color Time Screen Saver View 10,218 Replies 47
Original Poster Posted 2007-01-28 06:09 ·  中国 广东 佛山 中移铁通
中级用户
★★
Credits 256
Posts 93
Joined 2006-03-26 22:12
20-year member
UID 52853
Gender Male
From 广东
Status Offline
Long time no see, long time no play batch processing. Post a recently written batch processing for everyone!

xp tested successfully!

Modified on the 29th
Modified code
@echo off & setlocal EnableDelayedExpansion
mode con cols=100 lines=40
title COLOR TIME
call :tnb
set font=█★●◆□◎◇¤⊙〓

:new
rem Main function.
call :rdline
call :gt %time:~0,1% n
call :gt %time:~1,1% m
call :gt %time:~3,1% z
call :gt %time:~4,1% y

color 0%RANDOM:~-1%
set rdfont=!font:~%RANDOM:~-1%,1!

echo %nk% %date%
echo %nk% !%n%1:█=%rdfont%! !%m%1:█=%rdfont%! !%z%1:█=%rdfont%! !%y%1:█=%rdfont%!
echo %nk% !%n%2:█=%rdfont%! !%m%2:█=%rdfont%! !%z%2:█=%rdfont%! !%y%2:█=%rdfont%!
echo %nk% !%n%3:█=%rdfont%! !%m%3:█=%rdfont%! · !%z%3:█=%rdfont%! !%y%3:█=%rdfont%!
echo %nk% !%n%4:█=%rdfont%! !%m%4:█=%rdfont%! !%z%4:█=%rdfont%! !%y%4:█=%rdfont%!
echo %nk% !%n%5:█=%rdfont%! !%m%5:█=%rdfont%! · !%z%5:█=%rdfont%! !%y%5:█=%rdfont%!
echo %nk% www.cn-dos.net DOSCC WINBY.
ping 127.1 -n 3 >NUL
cls
set nk=
goto :new


:rdline
rem Randomly change the number of lines and left-right position.
set /A rdnb=%rdnb% + %RANDOM:~-1%
set /A rdnb=%rdnb% * 2
set /A rdnb=%rdnb% + %RANDOM:~-1%
set /A rdnb=%rdnb% + %RANDOM:~-1%
for /L %%a in (%rdnb% -1 1) do echo.
set rdnb=0
set /A rdnb=%rdnb% + %RANDOM:~-1%
set /A rdnb=%rdnb% + %RANDOM:~-1%
set /A rdnb=%rdnb% * 2
set /A rdnb=%rdnb% + %RANDOM:~-1%
for /L %%a in (1 1 %rdnb%) do set nk=!nk!
set rdnb=0
goto :EOF

:gt
rem Get the time and replace it with a digital appearance.
if "%1"=="n" call :gt 0 n
if "%1"=="0" call set %2=a
if "%1"=="1" call set %2=b
if "%1"=="2" call set %2=c
if "%1"=="3" call set %2=d
if "%1"=="4" call set %2=e
if "%1"=="5" call set %2=f
if "%1"=="6" call set %2=g
if "%1"=="7" call set %2=h
if "%1"=="8" call set %2=i
if "%1"=="9" call set %2=j
goto :EOF



:tnb
rem 0-9 digital appearance.
set a1=█████
set a2=█ █
set a3=█ █
set a4=█ █
set a5=█████

set b1= ██
set b2= █
set b3= █
set b4= █
set b5= █

set c1= ███
set c2= █
set c3=█████
set c4=█
set c5=█████

set d1= ███
set d2= █
set d3=█████
set d4= █
set d5=█████

set e1=█
set e2=█ █
set e3=█████
set e4= █
set e5= █

set f1=███
set f2=█
set f3=█████
set f4= █
set f5=█████

set g1=███
set g2=█
set g3=█████
set g4=█ █
set g5=█████

set h1=█████
set h2=█ █
set h3= █
set h4= █
set h5= █

set i1=█████
set i2=█ █
set i3=█████
set i4=█ █
set i5=█████

set j1=█████
set j2=█ █
set j3=█████
set j4= █
set j5= ████
goto :EOF



Original code
@echo off & setlocal EnableDelayedExpansion
mode con cols=100 lines=40
title COLOR TIME
call :tnb
set font=█★●◆□◎◇¤⊙〓

:new
rem Main function.
call :rdline
call :gt %time:~0,1% n
call :gt %time:~1,1% m
call :gt %time:~3,1% z
call :gt %time:~4,1% y

color 0%RANDOM:~-1%
set rdfont=!font:~%RANDOM:~-1%,1!

echo %nk% %date%
echo %nk% !%n%1:█=%rdfont%! !%m%1:█=%rdfont%! !%z%1:█=%rdfont%! !%y%1:█=%rdfont%!
echo %nk% !%n%2:█=%rdfont%! !%m%2:█=%rdfont%! !%z%2:█=%rdfont%! !%y%2:█=%rdfont%!
echo %nk% !%n%3:█=%rdfont%! !%m%3:█=%rdfont%! · !%z%3:█=%rdfont%! !%y%3:█=%rdfont%!
echo %nk% !%n%4:█=%rdfont%! !%m%4:█=%rdfont%! !%z%4:█=%rdfont%! !%y%4:█=%rdfont%!
echo %nk% !%n%5:█=%rdfont%! !%m%5:█=%rdfont%! · !%z%5:█=%rdfont%! !%y%5:█=%rdfont%!
echo %nk% www.cn-dos.net DOSCC WINBY.
ping 127.1 -n 3 >NUL
cls
set nk=
goto :new


:rdline
rem Randomly change the number of lines and left-right position.
call set /A rdnb=%rdnb% + %RANDOM:~-1%
call set /A rdnb=%rdnb% * 2
call set /A rdnb=%rdnb% + %RANDOM:~-1%
call set /A rdnb=%rdnb% + %RANDOM:~-1%
for /L %%a in (%rdnb% -1 1) do echo.
set rdnb=0
call set /A rdnb=%rdnb% + %RANDOM:~-1%
call set /A rdnb=%rdnb% + %RANDOM:~-1%
call set /A rdnb=%rdnb% * 2
call set /A rdnb=%rdnb% + %RANDOM:~-1%
for /L %%a in (1 1 %rdnb%) do set nk=!nk!
set rdnb=0
goto :EOF

:gt
rem Get the time and replace it with a digital appearance.
set t1=%1
set t2=%2
if "%t1%"=="n" (set t1=0) && set t2=n
if "%t1%"=="0" call set %t2%=a
if "%t1%"=="1" call set %t2%=b
if "%t1%"=="2" call set %t2%=c
if "%t1%"=="3" call set %t2%=d
if "%t1%"=="4" call set %t2%=e
if "%t1%"=="5" call set %t2%=f
if "%t1%"=="6" call set %t2%=g
if "%t1%"=="7" call set %t2%=h
if "%t1%"=="8" call set %t2%=i
if "%t1%"=="9" call set %t2%=j
goto :EOF



:tnb
rem 0-9 digital appearance.
set a1=█████
set a2=█ █
set a3=█ █
set a4=█ █
set a5=█████

set b1= ██
set b2= █
set b3= █
set b4= █
set b5= █

set c1= ███
set c2= █
set c3=█████
set c4=█
set c5=█████

set d1= ███
set d2= █
set d3=█████
set d4= █
set d5=█████

set e1=█
set e2=█ █
set e3=█████
set e4= █
set e5= █

set f1=███
set f2=█
set f3=█████
set f4= █
set f5=█████

set g1=███
set g2=█
set g3=█████
set g4=█ █
set g5=█████

set h1=█████
set h2=█ █
set h3= █
set h4= █
set h5= █

set i1=█████
set i2=█ █
set i3=█████
set i4=█ █
set i5=█████

set j1=█████
set j2=█ █
set j3=█████
set j4= █
set j5= ████
goto :EOF


[ Last edited by doscc on 2007-1-29 at 02:20 PM ]
Recent Ratings for This Post ( 7 in total) Click for details
RaterScoreTime
ccwan +5 2007-01-28 06:19
redtek +15 2007-01-28 08:36
lxmxn +6 2007-01-28 11:25
electronixtar +8 2007-01-28 11:42
0401 +4 2007-01-28 13:03
PPdos +4 2007-01-28 20:44
namejm +4 2007-01-30 12:57
Attachments
a.JPG
COLOR TIME.bat.txt (2.75 KiB, Credits to download 1 pts, Downloads: 42)
Floor 2 Posted 2007-01-28 06:10 ·  中国 广东 佛山 中移铁通
中级用户
★★
Credits 256
Posts 93
Joined 2006-03-26 22:12
20-year member
UID 52853
Gender Male
From 广东
Status Offline
Attachments
b.JPG
Floor 3 Posted 2007-01-28 06:19 ·  中国 河北 廊坊 三河市 移动
金牌会员
★★★★
Credits 2,725
Posts 1,160
Joined 2006-09-23 12:00
19-year member
UID 63486
From 河北廊坊
Status Offline
Very interesting stuff, support it.
三人行,必有吾师焉。 学然后知不足,教然后知困,然后能自强也。
Floor 4 Posted 2007-01-28 08:38 ·  中国 北京 朝阳区 联通
金牌会员
★★★★
Credits 2,902
Posts 1,147
Joined 2006-09-21 12:00
19-year member
UID 63324
Gender Male
Status Offline
Appreciate~~
Dynamic time changes, very interesting code~: )
And it especially resembles an animated screen saver, very cute!!!
    Redtek,一个永远在网上流浪的人……

_.,-*~'`^`'~*-,.__.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._
Floor 5 Posted 2007-01-28 08:58 ·  中国 湖南 长沙 电信
中级用户
★★
Credits 251
Posts 108
Joined 2007-01-07 11:33
19-year member
UID 75721
Gender Male
From 湖南==>广州
Status Offline
Good
DOS新人.多多指導
Floor 6 Posted 2007-01-28 09:34 ·  中国 浙江 电信
中级用户
★★
Credits 385
Posts 156
Joined 2007-01-19 02:32
19-year member
UID 76955
Gender Male
Status Offline
Great talent! You've reached such a high level in batch processing!
Floor 7 Posted 2007-01-28 10:07 ·  中国 北京 顺义区 联通
初级用户
Credits 65
Posts 32
Joined 2007-01-17 09:56
19-year member
UID 76791
Gender Male
Status Offline
High, really high!
Floor 8 Posted 2007-01-28 11:25 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
19-year member
UID 59080
Status Offline
Well, not bad, just like a screensaver... ^_^
Floor 9 Posted 2007-01-28 11:39 ·  中国 四川 成都 教育网
铂金会员
★★★★
Credits 7,493
Posts 2,672
Joined 2005-09-02 00:00
20-year member
UID 42173
Gender Male
Status Offline

C:\>BLOG http://initiative.yo2.cn/
C:\>hh.exe ntcmds.chm::/ntcmds.htm
C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>"
Floor 10 Posted 2007-01-28 13:04 ·  中国 北京 联通
中级用户
★★
带走
Credits 435
Posts 88
Joined 2005-09-24 19:22
20-year member
UID 42793
Status Offline
It's creative, and it also looks like a screensaver, heh heh.
Floor 11 Posted 2007-01-28 14:50 ·  中国 广东 佛山 中移铁通
中级用户
★★
Credits 256
Posts 93
Joined 2006-03-26 22:12
20-year member
UID 52853
Gender Male
From 广东
Status Offline
Thank you everyone for your support! This batch script is inspired by the Nokia S60 mobile phone screensaver.
Floor 12 Posted 2007-01-28 21:39 ·  美国 弗吉尼亚州 梅克伦堡县 博伊顿 Microsoft
高级用户
★★
Credits 783
Posts 268
Joined 2006-12-26 17:18
19-year member
UID 74627
Gender Male
Status Offline
Support! But there is a question, please the original poster to answer

call set /A rdnb=%rdnb% + %RANDOM:~-1%
call set /A rdnb=%rdnb% * 2
call set /A rdnb=%rdnb% + %RANDOM:~-1%
call set /A rdnb=%rdnb% + %RANDOM:~-1%
for /L %%a in (%rdnb% -1 1) do echo.
set rdnb=0
call set /A rdnb=%rdnb% + %RANDOM:~-1%
call set /A rdnb=%rdnb% + %RANDOM:~-1%
call set /A rdnb=%rdnb% * 2
call set /A rdnb=%rdnb% + %RANDOM:~-1%



Why use call here?
菩提本无树,明镜亦非台,本来无一物,何处惹尘埃.
Floor 13 Posted 2007-01-29 01:38 ·  中国 江苏 苏州 广电网(移动出口)
初级用户
Credits 72
Posts 35
Joined 2006-11-13 01:26
19-year member
UID 70380
Gender Male
Status Offline
Originally posted by doscc at 2007-1-28 01:50 AM:
Thanks everyone for your support! This batch script was inspired by the Nokia S60 mobile phone screensaver.


Wow! Do great people all come out at midnight?
Can you provide some brief comments?
Floor 14 Posted 2007-01-29 01:54 ·  中国 北京 联通
金牌会员
★★★★
Credits 2,902
Posts 1,147
Joined 2006-09-21 12:00
19-year member
UID 63324
Gender Male
Status Offline
A little suggestion~ :)

If brother's wonderful post can mark in the title that it contains "batch processing colored time animation" or "contains batch processing animation" and other title words, then in the future, when the forum is searched, it can quickly locate and find brother's post according to keywords such as "animation", "batch processing colored", "colored" and so on.

(Because the title of COLOR TIME is very difficult for netizens who have never seen brother's post content to find the post containing "animation" type and content through the forum search. I very much hope that brother's wonderful post can be located and searched by the needed netizens very quickly~ :)

(If the COLOR TIME title is still the name that brother likes very much or it represents the characteristics and theme spirit of the code in the post, in the post, you can also use a way similar to book classification search or file subject words so that more netizens can quickly find brother's post through the forum's search function in the future~ :)

For example:



And other related theme word lists that can quickly search for this post through the forum text content~ :)

[ Last edited by redtek on 2007-1-28 at 01:22 PM ]
    Redtek,一个永远在网上流浪的人……

_.,-*~'`^`'~*-,.__.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._
Floor 15 Posted 2007-01-29 02:05 ·  中国 北京 联通
金牌会员
★★★★
Credits 2,902
Posts 1,147
Joined 2006-09-21 12:00
19-year member
UID 63324
Gender Male
Status Offline
According to the topic word test, using the keyword "color animation" from the topic words on the 14th floor to apply the forum post retrieval function, a wonderful post from the brother has already been retrieved~ :)

[ Last edited by redtek on 2007-1-28 at 01:07 PM ]
Attachments
未命名.GIF
    Redtek,一个永远在网上流浪的人……

_.,-*~'`^`'~*-,.__.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._
Forum Jump: