|
eech
高级用户
   
积分 906
发帖 346
注册 2006-7-10
状态 离线
|
『楼 主』:
求一个可以记时的批处理
使用 LLM 解释/回答一下
比如从00:00:01开始的批处理
For example, a batch processing starting from 00:00:01
|
|
2007-1-19 12:17 |
|
|
PPdos
高级用户
   
积分 783
发帖 268
注册 2006-12-26
状态 离线
|
 『第 2 楼』:
语音消息框合并--定时器(xp)
使用 LLM 解释/回答一下
Rem 将文件名保存为你想设定的时间例如现在11:35:21你想设定为11:36运行
Rem 便更改文件名"计时器.bat"为1136.bat(精确到分钟,文件名补足4位)
@echo off&title 定时器&color 0D
mode con cols=15 lines=3&set l=%time: =0%&set n=%l::=%
if "%n:~0,-5%"=="%~n0" start mshta vbscript:CreateObject("SAPI.SpVoice").Speak("sorry Your time is limited!")(Window.close)&msg %username% Sorry your time is limited!
ping 127.0|set /p l= %time:~0,-3%&cls&%0
Msgbox "Sorry your time is limited"
Rem Save the file name as the time you want to set. For example, now it's 11:35:21 and you want to set it to run at 11:36.
Rem Then change the file name "Timer.bat" to 1136.bat (precise to minutes, fill the file name to 4 digits)
@echo off&title Timer&color 0D
mode con cols=15 lines=3&set l=%time: =0%&set n=%l::=%
if "%n:~0,-5%"=="%~n0" start mshta vbscript:CreateObject("SAPI.SpVoice").Speak("sorry Your time is limited!")(Window.close)&msg %username% Sorry your time is limited!
ping 127.0|set /p l= %time:~0,-3%&cls&%0
Msgbox "Sorry your time is limited"
此帖被 +7 点积分 点击查看详情 评分人:【 redtek 】 | 分数: +5 | 时间:2007-1-19 21:41 | 评分人:【 axi 】 | 分数: +2 | 时间:2007-3-16 11:58 |
|
附件
1: 定时器.rar (2007-1-19 20:59, 487 bytes, 下载附件所需积分 1 点
,下载次数: 139)
|

菩提本无树,明镜亦非台,本来无一物,何处惹尘埃. |
|
2007-1-19 20:58 |
|
|
boluor
初级用户
 
积分 129
发帖 54
注册 2007-1-4 来自 武大信息学部
状态 离线
|
『第 3 楼』:
使用 LLM 解释/回答一下
好象是每三秒改变一次,很不错了.不过你搞那个"your time is limited ",有什么用吗?搞得我以为是在修改我电脑上的时间啊,又惹的电脑出现了一个实时调试的对话框.....
It seems to change every three seconds, which is pretty good. But what's the use of you putting that "your time is limited"? It made me think I was modifying the time on my computer, and then a real-time debugging dialog box appeared on the computer again.....
|
|
2007-1-19 21:44 |
|
|
everest79
金牌会员
      一叶枝头,万树皆春
积分 2564
发帖 1127
注册 2006-12-25
状态 离线
|
 『第 4 楼』:
使用 LLM 解释/回答一下
试试看
@ECHO OFF
SET TIMEON=%TIME:~0,-3%
:TIME1
SET /A S9=%TIME:~7,1%,S1+=S
SET /A H=S1/3600,M=S1%%3600/60,S=S1%%3600%%60
CLS&ECHO stopwatch %H%:%M%:%S% current:%TIME:~0,-3% timeon:%TIMEON% secs=%S1% %S9%
::SET /A S1/(S1-100000) 2>nul||GOTO NEXT
:TIME0
SET /A S=(((%TIME:~7,1%-S9)*2+1)%%2*(%TIME:~7,1%-S9)*10)/(((%TIME:~7,1%-S9)*2+1)%%2*(%TIME:~7,1%-S9)*10-1)
GOTO TIME%S%
Let's see... The user provided a batch code snippet and wants it translated if needed. But the code is already in English in terms of the programming logic. Wait, no, the original Chinese was "试试看" which is "Let's try it". Then the code is as given. So the translated text would be:
Let's try it
@ECHO OFF
SET TIMEON=%TIME:~0,-3%
:TIME1
SET /A S9=%TIME:~7,1%,S1+=S
SET /A H=S1/3600,M=S1%%3600/60,S=S1%%3600%%60
CLS&ECHO stopwatch %H%:%M%:%S% current:%TIME:~0,-3% timeon:%TIMEON% secs=%S1% %S9%
::SET /A S1/(S1-100000) 2>nul||GOTO NEXT
:TIME0
SET /A S=(((%TIME:~7,1%-S9)*2+1)%%2*(%TIME:~7,1%-S9)*10)/(((%TIME:~7,1%-S9)*2+1)%%2*(%TIME:~7,1%-S9)*10-1)
GOTO TIME%S%
|
|
2007-1-19 21:59 |
|
|
PPdos
高级用户
   
积分 783
发帖 268
注册 2006-12-26
状态 离线
|
『第 5 楼』:
计时器
使用 LLM 解释/回答一下
@echo off&mode con cols=20 lines=2
title 计时器&color 0D
set /a H=0,M=0,S=0
set /a H=%t%%%86400/3600 2>nul
set /a M=%t%%%86400%%3600/60 2>nul
set /a S=%t%%%86400%%3600%%60 2>nul
@ping -n 2 127.0|set/p l= 已计时间: %H%:%M%:%S%&set /a t+=1&cls&%0
-n 修改为2 初始化参数为0 完成
Last edited by PPdos on 2007-1-24 at 11:52 PM ]
@echo off&mode con cols=20 lines=20
title Timer&color 0D
set /a H=0,M=0,S=0
set /a H=%t%%%86400/3600 2>nul
set /a M=%t%%%86400%%3600/60 2>nul
set /a S=%t%%%86400%%3600%%60 2>nul
@ping -n 2 127.0|set/p l=Elapsed time: %H%:%M%:%S%&set /a t+=1&cls&%0
-n changed to 2, initialized parameter to 0, done
Last edited by PPdos on 2007-1-24 at 11:52 PM ]
附件
1: 计时器.rar (2007-1-25 12:49, 274 bytes, 下载附件所需积分 1 点
,下载次数: 73)
|

菩提本无树,明镜亦非台,本来无一物,何处惹尘埃. |
|
2007-1-19 22:08 |
|
|
boluor
初级用户
 
积分 129
发帖 54
注册 2007-1-4 来自 武大信息学部
状态 离线
|
『第 6 楼』:
使用 LLM 解释/回答一下
果然是高啊....顶上来!!!!!!!!!!!
Sure, but there's no Chinese content here that needs translation. The text you provided is already in Chinese but the relevant part "果然是高啊....顶上来!!!!!!!!!!!" when translated literally is "Sure is high.... Push up!!!!!!!!!!!" But if we consider it's just an expression, maybe it's better to keep it as is if no translation is needed. Wait, actually, the task is to translate Chinese to English. But this is an exclamation. Let me rephrase: "Sure is clever.... Push it up!!!!!!!!!!!" But maybe a more natural way is "That's really smart.... Bump it up!!!!!!!!!!!"
|
|
2007-1-19 22:18 |
|
|
everest79
金牌会员
      一叶枝头,万树皆春
积分 2564
发帖 1127
注册 2006-12-25
状态 离线
|
『第 7 楼』:
使用 LLM 解释/回答一下
我的时间长还是出问题,挂在这执行了近一小时,突然退出了
稳定运行是内存占用588k,时间到不差,好像计算还有点问题
My time is either long or there's an issue. It has been running here for nearly an hour and then suddenly exited. Stable operation is with a memory usage of 588k, the time is correct, but it seems there's still some problem with the calculation.
|
|
2007-1-19 22:57 |
|
|
PPdos
高级用户
   
积分 783
发帖 268
注册 2006-12-26
状态 离线
|
『第 8 楼』:
使用 LLM 解释/回答一下
利用ping的计时器的缺点是 不准确但可通过修改参数来改变计时的速度
而定时器则是通过ping的延时来刷新屏幕从而显示已改变的时间 无论刷新的快与慢
时间的准确性并没改变 但是如果刷新太快也会出现占用内存过大的问题 所以在以上
程序中尽量降低了内存消耗,程序中渗透了很多论坛的思想 。(Msgbox测试后忘
了删除)
The disadvantage of using the timer of ping is that it is inaccurate but the speed of timing can be changed by modifying parameters. And the timer refreshes the screen through the delay of ping to display the changed time. No matter whether the refresh is fast or slow, the accuracy of time has not changed. But if the refresh is too fast, the problem of excessive memory occupation will also occur. So in the above program, the memory consumption is minimized as much as possible. There are many ideas from the forum infiltrated in the program. (Forgot to delete after Msgbox test)
|

菩提本无树,明镜亦非台,本来无一物,何处惹尘埃. |
|
2007-1-19 23:31 |
|
|
eech
高级用户
   
积分 906
发帖 346
注册 2006-7-10
状态 离线
|
『第 9 楼』:
使用 LLM 解释/回答一下
谢谢各位.试了.好像有点慢啊.嘿嘿.
Thanks everyone. I tried. It seems a bit slow. Hehe.
|
|
2007-1-20 01:14 |
|
|
tashaxin
初级用户
 
积分 99
发帖 30
注册 2007-1-19
状态 离线
|
|
2007-1-25 10:41 |
|
|
jackyggt
初级用户
 
积分 76
发帖 38
注册 2007-3-13
状态 离线
|
|
2007-3-16 07:49 |
|
|
liu3157551
中级用户
  
积分 259
发帖 164
注册 2006-9-21
状态 离线
|
『第 12 楼』:
使用 LLM 解释/回答一下
5楼的很不错!他的做法值得我学习!因为他上传并分享了成功的成果给别人! 2007-3-22 1:46:41星期四
The post on the 5th floor is quite good! His approach is worth my learning! Because he uploaded and shared the successful results with others! 2007-3-22 1:46:41 Thursday
|
|
2007-3-22 14:55 |
|
|
zhoushijay
高级用户
    Autowalk
积分 845
发帖 375
注册 2007-3-3
状态 离线
|
『第 13 楼』:
使用 LLM 解释/回答一下
@echo off
echo 请按任意键开始计时...
pause>nul
set a=0
set b=0
set c=0
:start
cls
echo 计时: %a%:%b%:%c%
set /a c+=1
if %c%==60 (set c=0
set /a b+=1
)
if %b%==60 (set b=0
set /a a+=1
)
ping -n 1 127.1>nul 2>nul
goto :start
没有测试完,呵呵
@echo off
echo Please press any key to start timing...
pause>nul
set a=0
set b=0
set c=0
:start
cls
echo Timing: %a%:%b%:%c%
set /a c+=1
if %c%==60 (set c=0
set /a b+=1
)
if %b%==60 (set b=0
set /a a+=1
)
ping -n 1 127.1>nul 2>nul
goto :start
Not fully tested, heh
|
|
2007-3-23 01:49 |
|
|
pmwz008
初级用户
 
积分 24
发帖 13
注册 2007-3-23
状态 离线
|
『第 14 楼』:
使用 LLM 解释/回答一下
果然是高啊....顶上来
Sure enough, it's really clever.... Push it up
|
|
2007-3-23 05:18 |
|
|
penghuahui
初级用户
 
积分 163
发帖 86
注册 2007-9-5
状态 离线
|
|
2007-12-5 13:40 |
|