标题: 【算是月贴】我尽量减少闪烁的批处理大时钟
[打印本页]
作者: 523066680
时间: 2008-7-25 09:42
标题: 【算是月贴】我尽量减少闪烁的批处理大时钟
::这一版本编辑if_exist
@echo off &color 0a
mode con cols=100 lines=30
setlocal enabledelayedexpansion
set 01=00000000000000
set 02=00 00
set 03=00 000000 00
set 04=00 000000 00
set 05=00 000000 00
set 06=00 00
set 07=00000000000000
set 11=00000000000000
set 12=0000 000000
set 13=000000 000000
set 14=000000 000000
set 15=000000 000000
set 16=0000 0000
set 17=00000000000000
set 21=00000000000000
set 22=00 00
set 23=0000000000 00
set 24=00 00
set 25=00 0000000000
set 26=00 00
set 27=00000000000000
set 31=00000000000000
set 32=00 00
set 33=0000000000 00
set 34=00 00
set 35=0000000000 00
set 36=00 00
set 37=00000000000000
set 41=00000000000000
set 42=00 0000 0000
set 43=00 0000 0000
set 44=00 00
set 45=00000000 0000
set 46=00000000 0000
set 47=00000000000000
set 51=00000000000000
set 52=00 00
set 53=00 0000000000
set 54=00 00
set 55=0000000000 00
set 56=00 00
set 57=00000000000000
set 61=00000000000000
set 62=00 00
set 63=00 0000000000
set 64=00 00
set 65=00 000000 00
set 66=00 00
set 67=00000000000000
set 71=00000000000000
set 72=00 00
set 73=0000000000 00
set 74=0000000000 00
set 75=0000000000 00
set 76=0000000000 00
set 77=00000000000000
set 81=00000000000000
set 82=00 00
set 83=00 000000 00
set 84=00 00
set 85=00 000000 00
set 86=00 00
set 87=00000000000000
set 91=00000000000000
set 92=00 00
set 93=00 000000 00
set 94=00 00
set 95=0000000000 00
set 96=00 00
set 97=00000000000000
:a
for /l %%a in (1,1,7) do (set hang%%a=)
for /f %%n in ('time /t') do (set t1=%%n &set t1=!t1:~0,1!)
set /a t2=%time:~1,1%,t3=%time:~3,1%,t4=%time:~4,1%
set /a t5=%time:~6,1%,t6=%time:~7,1%,t7=%time:~9,1%,t8=%time:~10,1%
for %%b in (%t1% %t2% %t3% %t4% %t5% %t6%) do (for /l %%a in (1,1,7) do (
set hang%%a=!hang%%a! !%%b%%a!))
for %%a in (1,2,4,6,7) do (
set hang%%a=!hang%%a:~0,30! !hang%%a:~31,30! !hang%%a:~61,30!)
set hang3=%hang3:~0,30% ● %hang3:~31,30% ● %hang3:~61,30%
set hang5=%hang5:~0,30% ● %hang5:~31,30% ● %hang5:~61,30%
ping -n>nul&ping -n>nul&ping -n>nul
cls
echo.&echo.&echo.&echo.
echo %hang1%
echo %hang2%
echo %hang3%
echo %hang4%
echo %hang5%
echo %hang6%
echo %hang7%
echo.&echo.&echo. -------%t7%%t8%
goto :a
[
Last edited by 523066680 on 2008-7-25 at 09:51 AM ]
作者: BC
时间: 2008-7-25 09:59
好像有点问题哦,显示9:51分时会显示成99:51
作者: 523066680
时间: 2008-7-25 10:33
啥?我看看 看错了吧 那个0跟9很像的
我这边的时钟改了看了一下 没问题啊
[
Last edited by 523066680 on 2008-7-25 at 10:35 AM ]
作者: bat-zw
时间: 2008-7-25 10:42
建议用。或*符号来代替,为了鼓励,加分。
作者: HAT
时间: 2008-7-25 11:51
建议把代码放到code标签里面,方便别人复制。
作者: BC
时间: 2008-7-25 14:58
提出个小建议,能不能不显示秒,然后减少刷新呢?
我记得坛里以前有个也是时钟,它是每秒变换一下位置,好像这样的感觉更好哦
作者: 523066680
时间: 2008-7-25 15:48
恩 接受大家的建议!
::编辑 if_exist hi.baidu.com/523066680
@echo off &color 0a
mode con cols=100 lines=30
setlocal enabledelayedexpansion
set 01=**************
set 02=** **
set 03=** ****** **
set 04=** ****** **
set 05=** ****** **
set 06=** **
set 07=**************
set 11=**************
set 12=**** ******
set 13=****** ******
set 14=****** ******
set 15=****** ******
set 16=**** ****
set 17=**************
set 21=**************
set 22=** **
set 23=********** **
set 24=** **
set 25=** **********
set 26=** **
set 27=**************
set 31=**************
set 32=** **
set 33=********** **
set 34=** **
set 35=********** **
set 36=** **
set 37=**************
set 41=**************
set 42=** **** ****
set 43=** **** ****
set 44=** **
set 45=******** ****
set 46=******** ****
set 47=**************
set 51=**************
set 52=** **
set 53=** **********
set 54=** **
set 55=********** **
set 56=** **
set 57=**************
set 61=**************
set 62=** **
set 63=** **********
set 64=** **
set 65=** ****** **
set 66=** **
set 67=**************
set 71=**************
set 72=** **
set 73=********** **
set 74=********** **
set 75=********** **
set 76=********** **
set 77=**************
set 81=**************
set 82=** **
set 83=** ****** **
set 84=** **
set 85=** ****** **
set 86=** **
set 87=**************
set 91=**************
set 92=** **
set 93=** ****** **
set 94=** **
set 95=********** **
set 96=** **
set 97=**************
:a
for /l %%a in (1,1,7) do (set hang%%a=)
for /f %%n in ('time /t') do (set t1=%%n &set t1=!t1:~0,1!)
set /a t2=%time:~1,1%,t3=%time:~3,1%,t4=%time:~4,1%
set /a t5=%time:~6,1%,t6=%time:~7,1%,t7=%time:~9,1%,t8=%time:~10,1%
for %%b in (%t1% %t2% %t3% %t4% %t5% %t6%) do (for /l %%a in (1,1,7) do (
set hang%%a=!hang%%a! !%%b%%a!))
for %%a in (1,2,4,6,7) do (
set hang%%a=!hang%%a:~0,30! !hang%%a:~31,30! !hang%%a:~61,30!)
set hang3=%hang3:~0,30% ● %hang3:~31,30% ● %hang3:~61,30%
set hang5=%hang5:~0,30% ● %hang5:~31,30% ● %hang5:~61,30%
for %%a in (1,2,3,4) do (ping -n>nul)
cls
echo.&echo.&echo.&echo.
echo %hang1%
echo %hang2%
echo %hang3%
echo %hang4%
echo %hang5%
echo %hang6%
echo %hang7%
goto :a
[
Last edited by 523066680 on 2008-7-25 at 08:35 PM ]
作者: 523066680
时间: 2008-7-25 15:55
我觉得要是把秒去掉就没特色了
我记得那个没有秒的,是大虾们做的时间屏保
代码很短哦!我觉得很牛
作者: recallshan
时间: 2008-7-25 17:03
不知道楼主是如何在time里获取到秒值的?
作者: radem
时间: 2008-7-25 19:09
稍微修改了一下,好看多了:lol:
另:7楼好象有错
@echo off &color 0a
title 批处理时钟
:: Edit by if_exist/Modified by radem @ www.cn-dos.net
mode con cols=65 lines=20
setlocal enabledelayedexpansion
set 01= 000000
set 02=00 00
set 03=00 00
set 04=00 00
set 05=00 00
set 06=00 00
set 07= 000000
set 11= 00
set 12= 000
set 13= 00
set 14= 00
set 15= 00
set 16= 00
set 17= 0000
set 21= 000000
set 22=00 00
set 23= 00
set 24= 000000
set 25=00
set 26=00
set 27=0000000
set 31= 000000
set 32=00 00
set 33= 00
set 34= 00000
set 35= 00
set 36=00 00
set 37= 000000
set 41= 0000
set 42= 00 00
set 43=00 00
set 44=00 00
set 45=00000000
set 46= 00
set 47= 00
set 51=0000000
set 52=00
set 53=00
set 54= 000000
set 55= 00
set 56=00 00
set 57= 000000
set 61= 000000
set 62=00 00
set 63=00
set 64=0000000
set 65=00 00
set 66=00 00
set 67= 000000
set 71= 0000000
set 72=00 00
set 73= 00
set 74= 00
set 75= 00
set 76= 00
set 77= 00
set 81= 000000
set 82=00 00
set 83=00 00
set 84= 000000
set 85=00 00
set 86=00 00
set 87= 000000
set 91= 000000
set 92=00 00
set 93=00 00
set 94= 0000000
set 95= 00
set 96=00 00
set 97= 000000
:a
for /l %%a in (1,1,7) do (set hang%%a=)
for /f %%n in ('time /t') do (set t1=%%n &set t1=!t1:~0,1!)
set /a t2=%time:~1,1%,t3=%time:~3,1%,t4=%time:~4,1%
set /a t5=%time:~6,1%,t6=%time:~7,1%,t7=%time:~9,1%,t8=%time:~10,1%
for %%b in (%t1% %t2% %t3% %t4% %t5% %t6%) do (for /l %%a in (1,1,7) do (
set hang%%a=!hang%%a! !%%b%%a!))
for %%a in (1,2,4,6,7) do (
set hang%%a=!hang%%a:~0,18! !hang%%a:~19,18! !hang%%a:~37,18!)
set hang3=%hang3:~0,18% ● %hang3:~19,18% ● %hang3:~37,18%
set hang5=%hang5:~0,18% ● %hang5:~19,18% ● %hang5:~37,18%
ping -n>nul&ping -n>nul&ping -n>nul
cls
echo.&echo.&echo.&echo.
echo %hang1%
echo %hang2%
echo %hang3%
echo %hang4%
echo %hang5%
echo %hang6%
echo %hang7%
goto :a
[
Last edited by radem on 2008-7-25 at 07:26 PM ]
作者: pusofalse
时间: 2008-7-25 19:58
厉害。。。
改成* 不行的原因可能是因为被当成了乘法运算符了吧。
作者: 523066680
时间: 2008-7-25 20:37
7楼的代码改过了,是因为转行的部分出现了 “断截”
代码被断了
10楼的靓仔有前途!!!效果不是一般的好!
作者: 220110
时间: 2008-7-25 21:35
最喜欢有创新~
作者: kidzgy
时间: 2008-7-27 09:46
10楼的厉害,太棒了,好漂亮啊~~~美观很多~
作者: 523066680
时间: 2008-7-28 11:21
郁闷……
@echo off
setlocal enabledelayedexpansion
set kong=
mode con cols=100 lines=20
color 0a
set 01=████
set 02=█ █
set 03=█ █
set 04=█ █
set 05=████
set 11= █
set 12= █
set 13= █
set 14= █
set 15= █
set 21=████
set 22= █
set 23=████
set 24=█
set 25=████
set 31=████
set 32= █
set 33=████
set 34= █
set 35=████
set 41=█ █
set 42=█ █
set 43=████
set 44= █
set 45= █
set 51=████
set 52=█
set 53=████
set 54= █
set 55=████
set 61=████
set 62=█
set 63=████
set 64=█ █
set 65=████
set 71=████
set 72= █
set 73= █
set 74= █
set 75= █
set 81=████
set 82=█ █
set 83=████
set 84=█ █
set 85=████
set 91=████
set 92=█ █
set 93=████
set 94= █
set 95=████
:a
for /l %%a in (1,1,5) do (
set hang%%a=!%time:~0,1%%%a! !%time:~1,1%%%a! !%time:~3,1%%%a! !%time:~4,1%%%a! !%time:~6,1%%%a! !%time:~7,1%%%a! !%time:~9,1%%%a! !%time:~10,1%%%a!
)
ping -n>nul
cls
echo %hang1%
echo %hang2%
echo %hang3%
echo %hang4%
echo %hang5%
goto :a
刚刚无意写成了斜体的……效果超好啊
http://www.cn-dos.net/forum/viewthread.php?tid=41833&fpage=1
作者: JIANHUILAI
时间: 2008-8-7 08:23
一个比一个牛.10楼,11楼的真是不错.
作者: gudou
时间: 2011-1-4 12:52
好厉害……没想批处理也能这样用!!
作者: 19900313
时间: 2011-1-5 18:23










作者: zaixinxiangnian
时间: 2011-1-15 00:15
每次运行都显示应用程序发生异常 unknown software exception
作者: modestleaner
时间: 2011-1-15 14:50
还是10楼的数字容易辨认,楼主第一次发那个看着眼睛有点花~
作者: modestleaner
时间: 2011-1-15 17:41
开着这个硬盘转得哗哗的响~~~·
作者: doslike
时间: 2011-1-15 18:26
这个……关于*号只要在前面加上转义符“^”就可以了
作者: cyn01livecn
时间: 2011-1-17 18:52
标题: 小建议
我觉得把 mode con cols=65 lines=20 这句改成 mode con cols=65 lines=8 会更好些。