[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖
回复 30# HOPE2021


    没有
梦依旧在,只是,心有余而力渐有不足
年年岁岁花相似,岁岁年年人不同

TOP

版本1.0.0014上半部分
  1. @echo off
  2. if not exist Logs\Time.ini set Time=100
  3. if exist Logs\Time.ini (
  4. cd Logs
  5. < Time.ini (
  6. set /p Time=
  7. )
  8. cd..
  9. )
  10. mode con cols=68 lines=5
  11. color f9
  12. endlocal
  13. setlocal enabledelayedexpansion
  14. chcp 936 > nul
  15. Rem By Hope2021
  16. title Hope计时器
  17. cls
  18. echo.
  19. echo.
  20. echo.                                HOPE
  21. call :Vbs_Sleep 1000
  22. call :Sleep_Installs
  23. @call :Restart
  24. @goto :Main
  25. :Restart
  26. color 0f
  27. cls
  28. set H=0
  29. set Min=0
  30. set S=0
  31. set H_2=0
  32. set Min_2=0
  33. set S_2=0
  34. set Ms=0
  35. set Ms_2=0
  36. @goto :eof
  37. :Main
  38. mode con cols=68 lines=7
  39. title Hope计时器
  40. set Error=0
  41. cls
  42. echo.
  43. echo.    ^>^> 当前计时时间:%H%小时%Min%分钟%S%秒
  44. echo.
  45. echo.  Q/W 小时加/减   E/R 分钟加/减   T/Y 秒加/减   U/I 开始计时//退出
  46. echo.
  47. echo.  P 打开计划程序  X 调试
  48. call :get_key
  49. call :Settings_Time
  50. if /i "!key!"=="P" (
  51. set St_1=10001
  52. set En_1=10010
  53. @goto :Task
  54. )
  55. if /i "!key!"=="u" (
  56. mode con cols=68 lines=5
  57. @goto :Start
  58. )
  59. if /i "!key!"=="x" (
  60. mode con cols=68 lines=34
  61. @goto :Debugging
  62. )
  63. if /i "!key!"=="i" (
  64. exit
  65. )
  66. if /i "!valid_key!" equ "0" goto :Main
  67. :Debugging
  68. echo.
  69. call :Echo_Debugging
  70. echo.    ^>^> 此向导将会帮助您调试您的设备是否适合运行 Hope (R) 计时器
  71. echo.
  72. echo.    ^>^> 请按回车键开始第一项检查...
  73. echo.
  74. pause > nul
  75. echo.
  76. call :Echo_Debugging
  77. echo.    ^>^> 正在调试 Certutil 性能...
  78. echo.
  79. echo.    ^>^> 请稍等...
  80. echo.
  81. echo.1 > ReturnKey.ini
  82. Certutil -encode ReturnKey.ini Hope.ini > nul
  83. if not exist Hope.ini (
  84. echo.    ^>^> 您的操作系统与 Certutil 不兼容, 无法运行Hope计时器...
  85. echo.
  86. echo.    ^>^> 请按回车键退出...
  87. pause > nul
  88. exit
  89. )
  90. if exist ReturnKey.ini del ReturnKey.ini
  91. if exist Hope.ini del Hope.ini
  92. echo.    ^>^> 您的操作系统与 Certutil 兼容, 可以运行Hope计时器...
  93. echo.
  94. echo.    ^>^> 请按回车键继续...
  95. pause > nul
  96. call :Echo_Debugging
  97. echo.    ^>^> 正在安装延时程序,请稍等...
  98. echo.
  99. call :Sleep_Installs
  100. echo.    ^>^> 接下来,您将会调试秒表, 我们将会为您进行系统标准计时...
  101. echo.
  102. echo.    ^>^> 我们会为你进行延时五秒,请您准备好您的计时设备...
  103. echo.
  104. echo.    ^>^> 请将您的计时设备置于您的电子计算机左侧, 打开计时设备但
  105. echo.
  106. echo.    ^>^> 不要开始计时, 请注意, 您按下回车键或空格键之后Hope计时
  107. echo.
  108. echo.    ^>^> 器将开始计时, 您应当同时启动Hope计时器与您的设备...
  109. echo.
  110. echo.    ^>^> 当Hope计时器的窗体变红时, 您应当停止您的计时设备, 按下
  111. echo.
  112. echo.    ^>^> 回车键, 并填写读数, Hope计时器会为您自动校准...
  113. pause > nul
  114. mode con cols=68 lines=5
  115. for /l %%i in (1,1,50) do (
  116. cls
  117. echo.
  118. echo.
  119. echo.    ^>^> %%i00 毫秒 / 5000 毫秒
  120. call :Sleep 100
  121. )
  122. color 4e
  123. cls
  124. echo.
  125. echo.
  126. echo.    ^>^> 请按回车键开始输入读数
  127. pause > nul
  128. cls
  129. echo.
  130. echo.
  131. set /p Math=    ^>^> 请输入读数:
  132. call :VisualSet Result 5/%Math%
  133. call :VisualSet Result 100*%Result%
  134. Md Logs >nul 2>nul
  135. echo.%Result% > Logs\Time.ini
  136. color 0f
  137. cls
  138. echo.
  139. echo.
  140. echo.    ^>^> 请按回车键退出本程序, 退出后, 请您重启本程序...
  141. pause > nul
  142. exit
  143. :VisualSet
  144. @echo off
  145. echo X=%~2>>VisualSet.vbs
  146. echo wscript.echo(X)>>VisualSet.vbs
  147. for /f %%a in ('cscript //nologo VisualSet.vbs') do set %1=%%a
  148. if exist VisualSet.vbs del VisualSet.vbs
  149. goto :eof
  150. :Echo_Debugging
  151. mode con cols=68 lines=34
  152. cls
  153. echo.
  154. echo.  Hope计时器[调试程序]
  155. set /p Str=--------------------------------------------------------------------<nul
  156. echo.
  157. echo.
  158. @goto :eof
  159. :Task
  160. Md Tasks >nul 2>nul
  161. cls
  162. title Hope计时器[计划程序]
  163. set Error=0
  164. echo.
  165. echo.  Hope计时器[计划程序]
  166. set /p Str=--------------------------------------------------------------------<nul
  167. echo.
  168. echo.
  169. echo.    ^>^> Q 新建计划   W 使用计划   D 删除计划   E 返回菜单   R 退出
  170. if not exist Tasks\*.Htd (
  171. echo.
  172. echo.    ^>^> 当前没有计划
  173. set /p Str=--------------------------------------------------------------------<nul
  174. echo.
  175. echo.
  176. )
  177. if not exist Tasks\Htd.Hdat echo.10000 > Tasks\Htd.Hdat
  178. if exist Tasks\*.Htd (
  179. cd Tasks
  180. echo.
  181. echo.    ^>^> 当前计划列表
  182. set /p Str=--------------------------------------------------------------------<nul
  183. echo.
  184. echo.
  185. for /f %%i in ('dir /b *.Htd') do (
  186. for /f "skip=4" %%j in (%%~ni.Htd) do echo.    ^>^> 编号:%%~ni  备注:%%j
  187. )
  188. echo.
  189. cd..
  190. )
  191. )
  192. call :get_key
  193. if /i "!key!"=="E" (
  194. @goto :Main
  195. )
  196. if /i "!key!"=="D" (
  197. @goto :Del
  198. )
  199. if /i "!key!"=="R" (
  200. exit
  201. )
  202. if /i "!key!"=="Q" (
  203. @goto :New
  204. )
  205. if /i "!key!"=="W" (
  206. @goto :Open
  207. )
  208. if /i "!valid_key!" equ "0" @goto :Task
  209. :Open
  210. if exist Tasks\*.Htd (
  211. set "Content= "
  212. set /p Content=    ^>^> 请输入计划编号:
  213. goto Open_2
  214. ) else cd..&@goto :Task
  215. :Del
  216. if exist Tasks\*.Htd (
  217. set "Content= "
  218. set /p Content=    ^>^> 请输入计划编号:
  219. goto Del_2
  220. ) else cd..&@goto :Task
  221. :Del_2
  222. cd Tasks
  223. if exist %Content%.Htd (
  224. del %Content%.Htd
  225. cd..
  226. goto Task
  227. ) else cd..&goto Task
  228. :Open_2
  229. cd Tasks
  230. if exist %Content%.Htd (
  231. call :Read %Content%
  232. cd..
  233. mode con cols=68 lines=5
  234. @goto :Start
  235. ) else cd..&goto Task
  236. :New
  237. cd Tasks
  238. < Htd.Hdat (
  239. set /p Num=
  240. )
  241. set /a Num+=1
  242. echo.%Num% > Htd.Hdat
  243. cd..
  244. echo.
  245. echo.    ^>^> 新建计划:%Num%
  246. echo.
  247. set "Content= "
  248. set /p Content=    ^>^> 备注:
  249. echo.
  250. set "Content=%Content:>=^>%"
  251. set "Content=%Content:<=^<%"
  252. set "Content=%Content:|=^|%"
  253. set H=0
  254. set Min=0
  255. set S=0
  256. set H_2=0
  257. set Min_2=0
  258. set S_2=0
  259. set Ms=0
  260. set Ms_2=0
  261. call :Vbs_Sleep 1000
  262. @goto :New_2
  263. :Read
  264. < %1.Htd (
  265. set /p H=
  266. set /p Min=
  267. set /p S=
  268. set /p Ms_2=
  269. set /p Content=
  270. )
  271. @goto :eof
  272. :New_2
  273. cls
  274. echo.
  275. echo.    ^>^> 当前计时时间:%H%小时%Min%分钟%S%秒
  276. echo.
  277. echo.  Q/W 小时加/减   E/R 分钟加/减   T/Y 秒加/减   U 完成计划
  278. echo.
  279. call :get_key
  280. call :Settings_Time
  281. if /i "!key!"=="U" (
  282. (
  283. echo.%H%
  284. echo.%Min%
  285. echo.%S%
  286. echo.%Ms_2%
  287. echo.%Content%
  288. ) > Tasks\%Num%.Htd
  289. @goto :Task
  290. )
  291. if /i "!valid_key!" equ "0" @goto :New_2
  292. :Error
  293. color 1f
  294. cls
  295. echo.
  296. echo.    ^>^> Sleep.exe 和 Sleep.com 不知到何处去了...
  297. echo.
  298. echo.    ^>^> 正在帮您恢复
  299. call :Sleep_Installs
  300. goto :Restart
复制代码

TOP

版本1.0.0014下半部分
  1. :Start
  2. set Error=0
  3. cls
  4. title 计时器[%H_2%小时%Min_2%分钟%S_2%秒/%H%小时%Min%分钟%S%秒]
  5. echo.
  6. echo.    ^>^> %H_2%小时%Min_2%分钟%S_2%秒%Ms%毫秒/%H%小时%Min%分钟%S%秒
  7. echo.
  8. echo.    ^>^> Ctrl+C暂停或退出...
  9. call :Sleep %Time%
  10. if %Error%==1 goto :Error
  11. set /a Ms+=100
  12. if %Ms%==1000 set /a S_2+=1&set Ms=0
  13. if %S_2% Geq 60 set /a Min_2+=1&set S_2=0
  14. if %Min_2% Geq 60 set /a H_2+=1&set Min_2=0
  15. if %H_2% Geq %H% if %Min_2% Geq %Min% if %S_2% Geq %S% goto :End
  16. if /i "!valid_key!" equ "0" goto :Start
  17. :End
  18. cls
  19. color 4e
  20. title 计时器[%H_2%小时%Min_2%分钟%S_2%秒/%H%小时%Min%分钟%S%秒]
  21. Call :Msg "时间到" vbExclamation "Hope计时器"
  22. color 0f
  23. @call :Restart
  24. @goto :Main
  25. :Vbs_Sleep
  26. echo.Wscript.Sleep %1 > Sleep.vbs
  27. call Sleep.vbs > nul
  28. if exist ReturnKey.vbs del ReturnKey.vbs
  29. @goto :eof
  30. :Sleep_Installs
  31. color 0f
  32. (
  33. echo.-----BEGIN CERTIFICATE-----
  34. echo.TVpQAQEAAAAEAAAA//8AAFABAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  35. echo.AAAAAAAAAAAAAAAAkAAAAPy+gQAPtkz/ZjHSZjHASXggrCwwchQ8CXcQZmvSCmYB
  36. echo.wi7HBi8AMQDr5C7/Ji8ADgBmadLoAwAAZonRZsHpELSGzRW4AEzNIQAAAAAAAAAA
  37. echo.UEUAAEwBAQBQeaU2AAAAAAAAAADgAA8BCwEFDAACAAAAAAAAAAAAAH4QAAAAEAAA
  38. echo.ACAAAAAAQAAAEAAAAAIAAAQAAAAAAAAABAAAAAAAAAAAIAAAAAIAAAAAAAADAAAA
  39. echo.AAAQAAAQAAAAABAAABAAAAAAAAAQAAAAAAAAAAAAAAAQEAAAKAAAAAAAAAAAAAAA
  40. echo.AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  41. echo.AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAABAAAAAAAAAAAAAAAAAAAAAAAAAA
  42. echo.AAAAAAAAAAAudGV4dAAAANwAAAAAEAAAAAIAAAACAAAAAAAAAAAAAAAAAAAgAADg
  43. echo.AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  44. echo.AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABWEAAAZBAAAHYQAAAAAAAA
  45. echo.RhAAAAAAAAAAAAAAOBAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEtFUk5FTDMy
  46. echo.LmRsbAAAVhAAAGQQAAB2EAAAAAAAAAAARXhpdFByb2Nlc3MAAABHZXRDb21tYW5k
  47. echo.TGluZUEAAABTbGVlcAD/FQQQQAAx0khAgDgAdBGAOCJ1AvfSCdJ174A4IHXqQPyJ
  48. echo.xjHSMcCsCMB0IywwchU8CXcRa9IKAcLHBckQQADNEEAA6+L/JckQQAClEEAAUv8V
  49. echo.CBBAAGoA/xUAEEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  50. echo.AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  51. echo.AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  52. echo.AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  53. echo.AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  54. echo.AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  55. echo.AAAAAAAAAAAAAAAAAAAAAA==
  56. echo.-----END CERTIFICATE-----
  57. ) > Sleep.com
  58. Certutil -Decode Sleep.com Sleep.exe > nul
  59. Certutil -Decode -f Sleep.com Sleep.com > nul
  60. goto :eof
  61. :Sleep
  62. set Error=0
  63. if exist Sleep.exe (
  64. Sleep.exe %1
  65. goto :eof
  66. )
  67. if not exist Sleep.exe if exist Sleep.com (
  68. Sleep.com %1
  69. goto :eof
  70. )
  71. if not exist Sleep.exe if not exist Sleep.com (
  72. set Error=1
  73. goto :eof
  74. )
  75. :get_key
  76. rem 用法:call :get_key
  77. set "key="
  78.   for /f "delims=" %%a in ('xcopy /w "%~f0" "%~f0" 2^>nul') do if not defined key set "key=%%a"
  79.   set "key=%key:~-1%"
  80.   set "valid_key=0"
  81. goto :eof
  82. :Msg
  83. Rem 用法: Call :Msg "Text" [buttons] "Title"
  84. echo.Msg=msgbox("%~1",%2,"%~3") > ReturnKey.vbs
  85. Call ReturnKey.vbs > nul
  86. if exist ReturnKey.vbs del ReturnKey.vbs
  87. goto :eof
  88. :Settings_Time
  89. if %Ms_2% Leq 200000000 if %H% geq 0 if %Min% Geq 0 if %S% Geq 0 (
  90. if /i "!key!"=="q" (
  91. set /a Ms_2+=3600000
  92. set /a H+=1
  93. )
  94. if /i "!key!"=="w" (
  95. set /a Ms_2-=3600000
  96. set /a H-=1
  97. )
  98. if /i "!key!"=="e" (
  99. set /a Ms_2+=60000
  100. set /a Min+=1
  101. )
  102. if /i "!key!"=="r" (
  103. set /a Ms_2-=60000
  104. set /a Min-=1
  105. )
  106. if /i "!key!"=="t" (
  107. set /a Ms_2+=1000
  108. set /a S+=1
  109. )
  110. if /i "!key!"=="y" (
  111. set /a Ms_2-=1000
  112. set /a S-=1
  113. )
  114. )
  115. if %S% Lss 0 (
  116. if %Min% Geq 0 if %H% Geq 0 (
  117. set /a Min-=1&set /a S+=60
  118. )
  119. if %Min% Leq 0 if %H% Leq 0 (
  120. echo.
  121. echo.    ^>^> 算数错误!
  122. call :Vbs_Sleep 100
  123. @call :Restart
  124. )
  125. )
  126. if %Min% Lss 0 (
  127. if %H% Gtr 0 set /a H-=1&set /a Min+=60
  128. if %H% Leq 0 (
  129. echo.
  130. echo.    ^>^> 算数错误!
  131. call :Vbs_Sleep 100
  132. @call :Restart
  133. )
  134. )
  135. if %H% Lss 0 (
  136. echo.
  137. echo.    ^>^> 算数错误!
  138. call :Vbs_Sleep 100
  139. @call :Restart
  140. )
  141. if %Ms_2% Gtr 200000000 (
  142. echo.
  143. echo.    ^>^> 算数错误!
  144. call :Vbs_Sleep 100
  145. @call :Restart
  146. )
  147. if %S% Geq 60 set /a Min+=1&set S=0
  148. if %Min% Geq 60 set /a H+=1&set Min=0
复制代码

TOP

回复 31# cmd1152
那您尝试把Time.ini中的数值调小一点...

TOP

版本1.0.0015上半部分
  1. @echo off
  2. if not exist Logs\Time.ini set Time=100
  3. if exist Logs\Time.ini (
  4. cd Logs
  5. < Time.ini (
  6. set /p Time=
  7. )
  8. cd..
  9. )
  10. mode con cols=68 lines=5
  11. color f9
  12. endlocal
  13. setlocal enabledelayedexpansion
  14. chcp 936 > nul
  15. Rem By Hope2021
  16. title Hope计时器
  17. cls
  18. echo.
  19. echo.
  20. echo.                                HOPE
  21. call :Vbs_Sleep 1000
  22. call :Sleep_Installs
  23. @call :Restart
  24. @goto :Main
  25. :Restart
  26. color 0f
  27. cls
  28. set H=0
  29. set Min=0
  30. set S=0
  31. set H_2=0
  32. set Min_2=0
  33. set S_2=0
  34. set Ms=0
  35. set Ms_2=0
  36. @goto :eof
  37. :Main
  38. mode con cols=68 lines=7
  39. title Hope计时器
  40. set Error=0
  41. cls
  42. echo.
  43. echo.    ^>^> 当前计时时间:%H%小时%Min%分钟%S%秒
  44. echo.
  45. echo.  Q/W 小时加/减   E/R 分钟加/减   T/Y 秒加/减   U/I 开始计时//退出
  46. echo.
  47. echo.  P 打开计划程序  X 调试
  48. call :get_key
  49. call :Settings_Time
  50. if /i "!key!"=="P" (
  51. set St_1=10001
  52. set En_1=10010
  53. @goto :Task
  54. )
  55. if /i "!key!"=="u" (
  56. mode con cols=68 lines=5
  57. @goto :Start
  58. )
  59. if /i "!key!"=="x" (
  60. mode con cols=68 lines=34
  61. @goto :Debugging
  62. )
  63. if /i "!key!"=="i" (
  64. exit
  65. )
  66. if /i "!valid_key!" equ "0" goto :Main
  67. :Debugging
  68. echo.
  69. call :Echo_Debugging
  70. echo.    ^>^> 此向导将会帮助您调试您的设备是否适合运行 Hope (R) 计时器
  71. echo.
  72. echo.    ^>^> 请按回车键开始第一项检查...
  73. echo.
  74. pause > nul
  75. echo.
  76. call :Echo_Debugging
  77. echo.    ^>^> 正在调试 Certutil 性能...
  78. echo.
  79. echo.    ^>^> 请稍等...
  80. echo.
  81. echo.1 > ReturnKey.ini
  82. Certutil -encode ReturnKey.ini Hope.ini > nul
  83. if not exist Hope.ini (
  84. echo.    ^>^> 您的操作系统与 Certutil 不兼容, 无法运行Hope计时器...
  85. echo.
  86. echo.    ^>^> 请按回车键退出...
  87. pause > nul
  88. exit
  89. )
  90. if exist ReturnKey.ini del ReturnKey.ini
  91. if exist Hope.ini del Hope.ini
  92. echo.    ^>^> 您的操作系统与 Certutil 兼容, 可以运行Hope计时器...
  93. echo.
  94. echo.    ^>^> 请按回车键继续...
  95. pause > nul
  96. call :Echo_Debugging
  97. echo.    ^>^> 正在安装延时程序,请稍等...
  98. echo.
  99. call :Sleep_Installs
  100. echo.    ^>^> 接下来,您将会调试秒表, 我们将会为您进行系统标准计时...
  101. echo.
  102. echo.    ^>^> 我们会为你进行延时五秒,请您准备好您的计时设备...
  103. echo.
  104. echo.    ^>^> 请将您的计时设备置于您的电子计算机左侧, 打开计时设备但
  105. echo.
  106. echo.    ^>^> 不要开始计时, 请注意, 您按下回车键或空格键之后Hope计时
  107. echo.
  108. echo.    ^>^> 器将开始计时, 您应当同时启动Hope计时器与您的设备...
  109. echo.
  110. echo.    ^>^> 当Hope计时器的窗体变红时, 您应当停止您的计时设备, 按下
  111. echo.
  112. echo.    ^>^> 回车键, 并填写读数, Hope计时器会为您自动校准...
  113. pause > nul
  114. mode con cols=68 lines=5
  115. for /l %%i in (1,1,50) do (
  116. cls
  117. echo.
  118. echo.
  119. echo.    ^>^> %%i00 毫秒 / 5000 毫秒
  120. call :Sleep 100
  121. )
  122. color 4e
  123. cls
  124. echo.
  125. echo.
  126. echo.    ^>^> 请按回车键开始输入读数
  127. pause > nul
  128. cls
  129. echo.
  130. echo.
  131. set /p Math=    ^>^> 请输入读数:
  132. call :VisualSet Result 5/%Math%
  133. call :VisualSet Result 100*%Result%
  134. Md Logs >nul 2>nul
  135. echo.%Result% > Logs\Time.ini
  136. color 0f
  137. cls
  138. echo.
  139. echo.
  140. echo.    ^>^> 请按回车键退出本程序, 退出后, 请您重启本程序...
  141. pause > nul
  142. exit
  143. :VisualSet
  144. @echo off
  145. echo X=%~2>>VisualSet.vbs
  146. echo wscript.echo(X)>>VisualSet.vbs
  147. for /f %%a in ('cscript //nologo VisualSet.vbs') do set %1=%%a
  148. if exist VisualSet.vbs del VisualSet.vbs
  149. goto :eof
  150. :Echo_Debugging
  151. mode con cols=68 lines=34
  152. cls
  153. echo.
  154. echo.  Hope计时器[调试程序]
  155. set /p Str=--------------------------------------------------------------------<nul
  156. echo.
  157. echo.
  158. @goto :eof
  159. :Task
  160. mode con cols=68 lines=34
  161. Md Tasks >nul 2>nul
  162. cls
  163. title Hope计时器[计划程序]
  164. set Error=0
  165. echo.
  166. echo.  Hope计时器[计划程序]
  167. set /p Str=--------------------------------------------------------------------<nul
  168. echo.
  169. echo.
  170. echo.    ^>^> Q 新建计划   W 使用计划   D 删除计划   E 返回菜单   R 退出
  171. if not exist Tasks\*.Htd (
  172. echo.
  173. echo.    ^>^> 当前没有计划
  174. set /p Str=--------------------------------------------------------------------<nul
  175. echo.
  176. echo.
  177. )
  178. if not exist Tasks\Htd.Hdat echo.10000 > Tasks\Htd.Hdat
  179. if exist Tasks\*.Htd (
  180. cd Tasks
  181. echo.
  182. echo.    ^>^> 当前计划列表
  183. set /p Str=--------------------------------------------------------------------<nul
  184. echo.
  185. echo.
  186. for /f %%i in ('dir /b *.Htd') do (
  187. for /f "skip=4" %%j in (%%~ni.Htd) do echo.    ^>^> 编号:%%~ni  备注:%%j
  188. )
  189. echo.
  190. cd..
  191. )
  192. )
  193. call :get_key
  194. if /i "!key!"=="E" (
  195. @goto :Main
  196. )
  197. if /i "!key!"=="D" (
  198. @goto :Del
  199. )
  200. if /i "!key!"=="R" (
  201. exit
  202. )
  203. if /i "!key!"=="Q" (
  204. @goto :New
  205. )
  206. if /i "!key!"=="W" (
  207. @goto :Open
  208. )
  209. if /i "!valid_key!" equ "0" @goto :Task
  210. :Open
  211. if exist Tasks\*.Htd (
  212. set "Content= "
  213. set /p Content=    ^>^> 请输入计划编号:
  214. goto Open_2
  215. ) else cd..&@goto :Task
  216. :Del
  217. if exist Tasks\*.Htd (
  218. set "Content= "
  219. set /p Content=    ^>^> 请输入计划编号:
  220. goto Del_2
  221. ) else cd..&@goto :Task
  222. :Del_2
  223. cd Tasks
  224. if exist %Content%.Htd (
  225. del %Content%.Htd
  226. cd..
  227. goto Task
  228. ) else cd..&goto Task
  229. :Open_2
  230. cd Tasks
  231. if exist %Content%.Htd (
  232. call :Read %Content%
  233. cd..
  234. mode con cols=68 lines=5
  235. @goto :Start
  236. ) else cd..&goto Task
  237. :New
  238. cd Tasks
  239. < Htd.Hdat (
  240. set /p Num=
  241. )
  242. set /a Num+=1
  243. echo.%Num% > Htd.Hdat
  244. cd..
  245. echo.
  246. echo.    ^>^> 新建计划:%Num%
  247. echo.
  248. set "Content= "
  249. set /p Content=    ^>^> 备注:
  250. echo.
  251. set "Content=%Content:>=^>%"
  252. set "Content=%Content:<=^<%"
  253. set "Content=%Content:|=^|%"
  254. set H=0
  255. set Min=0
  256. set S=0
  257. set H_2=0
  258. set Min_2=0
  259. set S_2=0
  260. set Ms=0
  261. set Ms_2=0
  262. call :Vbs_Sleep 1000
  263. @goto :New_2
  264. :Read
  265. < %1.Htd (
  266. set /p H=
  267. set /p Min=
  268. set /p S=
  269. set /p Ms_2=
  270. set /p Content=
  271. )
  272. @goto :eof
  273. :New_2
  274. cls
  275. echo.
  276. echo.    ^>^> 当前计时时间:%H%小时%Min%分钟%S%秒
  277. echo.
  278. echo.  Q/W 小时加/减   E/R 分钟加/减   T/Y 秒加/减   U 完成计划
  279. echo.
  280. call :get_key
  281. call :Settings_Time
  282. if /i "!key!"=="U" (
  283. (
  284. echo.%H%
  285. echo.%Min%
  286. echo.%S%
  287. echo.%Ms_2%
  288. echo.%Content%
  289. ) > Tasks\%Num%.Htd
  290. @goto :Task
  291. )
  292. if /i "!valid_key!" equ "0" @goto :New_2
  293. :Error
  294. color 1f
  295. cls
  296. echo.
  297. echo.    ^>^> Sleep.exe 和 Sleep.com 不知到何处去了...
  298. echo.
  299. echo.    ^>^> 正在帮您恢复
  300. call :Sleep_Installs
  301. goto :Restart
  302. :Start
  303. set Error=0
  304. cls
  305. title 计时器[%H_2%小时%Min_2%分钟%S_2%秒/%H%小时%Min%分钟%S%秒]
  306. echo.
  307. echo.    ^>^> %H_2%小时%Min_2%分钟%S_2%秒%Ms%毫秒/%H%小时%Min%分钟%S%秒
  308. echo.
  309. echo.    ^>^> Ctrl+C暂停或退出...
  310. call :Sleep %Time%
  311. if %Error%==1 goto :Error
  312. set /a Ms+=100
  313. if %Ms%==1000 set /a S_2+=1&set Ms=0
  314. if %S_2% Geq 60 set /a Min_2+=1&set S_2=0
  315. if %Min_2% Geq 60 set /a H_2+=1&set Min_2=0
  316. if %H_2% Geq %H% if %Min_2% Geq %Min% if %S_2% Geq %S% goto :End
  317. if /i "!valid_key!" equ "0" goto :Start
  318. :End
  319. cls
  320. color 4e
  321. title 计时器[%H_2%小时%Min_2%分钟%S_2%秒/%H%小时%Min%分钟%S%秒]
  322. Call :Msg "时间到" vbExclamation "Hope计时器"
  323. color 0f
  324. @call :Restart
  325. @goto :Main
  326. :Vbs_Sleep
  327. echo.Wscript.Sleep %1 > Sleep.vbs
  328. call Sleep.vbs > nul
  329. if exist ReturnKey.vbs del ReturnKey.vbs
  330. @goto :eof
复制代码

TOP

版本1.0.0015下半部分
  1. :Sleep_Installs
  2. color 0f
  3. (
  4. echo.-----BEGIN CERTIFICATE-----
  5. echo.TVpQAQEAAAAEAAAA//8AAFABAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  6. echo.AAAAAAAAAAAAAAAAkAAAAPy+gQAPtkz/ZjHSZjHASXggrCwwchQ8CXcQZmvSCmYB
  7. echo.wi7HBi8AMQDr5C7/Ji8ADgBmadLoAwAAZonRZsHpELSGzRW4AEzNIQAAAAAAAAAA
  8. echo.UEUAAEwBAQBQeaU2AAAAAAAAAADgAA8BCwEFDAACAAAAAAAAAAAAAH4QAAAAEAAA
  9. echo.ACAAAAAAQAAAEAAAAAIAAAQAAAAAAAAABAAAAAAAAAAAIAAAAAIAAAAAAAADAAAA
  10. echo.AAAQAAAQAAAAABAAABAAAAAAAAAQAAAAAAAAAAAAAAAQEAAAKAAAAAAAAAAAAAAA
  11. echo.AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  12. echo.AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAABAAAAAAAAAAAAAAAAAAAAAAAAAA
  13. echo.AAAAAAAAAAAudGV4dAAAANwAAAAAEAAAAAIAAAACAAAAAAAAAAAAAAAAAAAgAADg
  14. echo.AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  15. echo.AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABWEAAAZBAAAHYQAAAAAAAA
  16. echo.RhAAAAAAAAAAAAAAOBAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEtFUk5FTDMy
  17. echo.LmRsbAAAVhAAAGQQAAB2EAAAAAAAAAAARXhpdFByb2Nlc3MAAABHZXRDb21tYW5k
  18. echo.TGluZUEAAABTbGVlcAD/FQQQQAAx0khAgDgAdBGAOCJ1AvfSCdJ174A4IHXqQPyJ
  19. echo.xjHSMcCsCMB0IywwchU8CXcRa9IKAcLHBckQQADNEEAA6+L/JckQQAClEEAAUv8V
  20. echo.CBBAAGoA/xUAEEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  21. echo.AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  22. echo.AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  23. echo.AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  24. echo.AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  25. echo.AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  26. echo.AAAAAAAAAAAAAAAAAAAAAA==
  27. echo.-----END CERTIFICATE-----
  28. ) > Sleep.com
  29. Certutil -Decode Sleep.com Sleep.exe > nul
  30. Certutil -Decode -f Sleep.com Sleep.com > nul
  31. goto :eof
  32. :Sleep
  33. set Error=0
  34. if exist Sleep.exe (
  35. Sleep.exe %1
  36. goto :eof
  37. )
  38. if not exist Sleep.exe if exist Sleep.com (
  39. Sleep.com %1
  40. goto :eof
  41. )
  42. if not exist Sleep.exe if not exist Sleep.com (
  43. set Error=1
  44. goto :eof
  45. )
  46. :get_key
  47. rem 用法:call :get_key
  48. set "key="
  49.   for /f "delims=" %%a in ('xcopy /w "%~f0" "%~f0" 2^>nul') do if not defined key set "key=%%a"
  50.   set "key=%key:~-1%"
  51.   set "valid_key=0"
  52. goto :eof
  53. :Msg
  54. Rem 用法: Call :Msg "Text" [buttons] "Title"
  55. echo.Msg=msgbox("%~1",%2,"%~3") > ReturnKey.vbs
  56. Call ReturnKey.vbs > nul
  57. if exist ReturnKey.vbs del ReturnKey.vbs
  58. goto :eof
  59. :Settings_Time
  60. if %Ms_2% Leq 200000000 if %H% geq 0 if %Min% Geq 0 if %S% Geq 0 (
  61. if /i "!key!"=="q" (
  62. set /a Ms_2+=3600000
  63. set /a H+=1
  64. )
  65. if /i "!key!"=="w" (
  66. set /a Ms_2-=3600000
  67. set /a H-=1
  68. )
  69. if /i "!key!"=="e" (
  70. set /a Ms_2+=60000
  71. set /a Min+=1
  72. )
  73. if /i "!key!"=="r" (
  74. set /a Ms_2-=60000
  75. set /a Min-=1
  76. )
  77. if /i "!key!"=="t" (
  78. set /a Ms_2+=1000
  79. set /a S+=1
  80. )
  81. if /i "!key!"=="y" (
  82. set /a Ms_2-=1000
  83. set /a S-=1
  84. )
  85. )
  86. if %S% Lss 0 (
  87. if %Min% Geq 0 if %H% Geq 0 (
  88. set /a Min-=1&set /a S+=60
  89. )
  90. if %Min% Leq 0 if %H% Leq 0 (
  91. echo.
  92. echo.    ^>^> 算数错误!
  93. call :Vbs_Sleep 100
  94. @call :Restart
  95. )
  96. )
  97. if %Min% Lss 0 (
  98. if %H% Gtr 0 set /a H-=1&set /a Min+=60
  99. if %H% Leq 0 (
  100. echo.
  101. echo.    ^>^> 算数错误!
  102. call :Vbs_Sleep 100
  103. @call :Restart
  104. )
  105. )
  106. if %H% Lss 0 (
  107. echo.
  108. echo.    ^>^> 算数错误!
  109. call :Vbs_Sleep 100
  110. @call :Restart
  111. )
  112. if %Ms_2% Gtr 200000000 (
  113. echo.
  114. echo.    ^>^> 算数错误!
  115. call :Vbs_Sleep 100
  116. @call :Restart
  117. )
  118. if %S% Geq 60 set /a Min+=1&set S=0
  119. if %Min% Geq 60 set /a H+=1&set Min=0
复制代码

TOP

回复 36# HOPE2021


    调小也不行
梦依旧在,只是,心有余而力渐有不足
年年岁岁花相似,岁岁年年人不同

TOP

本帖最后由 HOPE2021 于 2021-8-13 12:10 编辑

回复 37# cmd1152
调零呢?
如果不行我也无能为力了...

TOP

版本1.0.0016上半部分
  1. @echo off
  2. if not exist Logs\Time.ini set Time=100
  3. if exist Logs\Time.ini (
  4. cd Logs
  5. < Time.ini (
  6. set /p Time=
  7. )
  8. cd..
  9. )
  10. mode con cols=68 lines=5
  11. color f9
  12. endlocal
  13. setlocal enabledelayedexpansion
  14. chcp 936 > nul
  15. Rem By Hope2021
  16. title Hope计时器
  17. cls
  18. echo.
  19. echo.
  20. echo.                                HOPE
  21. call :Vbs_Sleep 1000
  22. call :Sleep_Installs
  23. @call :Restart
  24. @goto :Main
  25. :Restart
  26. color 0f
  27. cls
  28. set H=0
  29. set Min=0
  30. set S=0
  31. set H_2=0
  32. set Min_2=0
  33. set S_2=0
  34. set Ms=0
  35. set Ms_2=0
  36. @goto :eof
  37. :Main
  38. mode con cols=68 lines=7
  39. title Hope计时器
  40. set Error=0
  41. cls
  42. echo.
  43. echo.    ^>^> 当前计时时间:%H%小时%Min%分钟%S%秒
  44. echo.
  45. echo.  Q/W 小时加/减   E/R 分钟加/减   T/Y 秒加/减   U/I 开始计时//退出
  46. echo.
  47. echo.  P 打开计划程序  X 调试
  48. call :get_key
  49. call :Settings_Time
  50. if /i "!key!"=="P" (
  51. set St_1=10001
  52. set En_1=10010
  53. @goto :Task
  54. )
  55. if /i "!key!"=="u" (
  56. mode con cols=68 lines=5
  57. set "Title=时间到!!!"
  58. @goto :Start
  59. )
  60. if /i "!key!"=="x" (
  61. mode con cols=68 lines=34
  62. @goto :Debugging
  63. )
  64. if /i "!key!"=="i" (
  65. exit
  66. )
  67. if /i "!valid_key!" equ "0" goto :Main
  68. :Debugging
  69. echo.
  70. call :Echo_Debugging
  71. echo.    ^>^> 此向导将会帮助您调试您的设备是否适合运行 Hope (R) 计时器
  72. echo.
  73. echo.    ^>^> 请按回车键开始第一项检查...
  74. echo.
  75. pause > nul
  76. echo.
  77. call :Echo_Debugging
  78. echo.    ^>^> 正在调试 Certutil 性能...
  79. echo.
  80. echo.    ^>^> 请稍等...
  81. echo.
  82. echo.1 > ReturnKey.ini
  83. Certutil -encode ReturnKey.ini Hope.ini > nul
  84. if not exist Hope.ini (
  85. echo.    ^>^> 您的操作系统与 Certutil 不兼容, 无法运行Hope计时器...
  86. echo.
  87. echo.    ^>^> 请按回车键退出...
  88. pause > nul
  89. exit
  90. )
  91. if exist ReturnKey.ini del ReturnKey.ini
  92. if exist Hope.ini del Hope.ini
  93. echo.    ^>^> 您的操作系统与 Certutil 兼容, 可以运行Hope计时器...
  94. echo.
  95. echo.    ^>^> 请按回车键继续...
  96. pause > nul
  97. call :Echo_Debugging
  98. echo.    ^>^> 正在安装延时程序,请稍等...
  99. echo.
  100. call :Sleep_Installs
  101. echo.    ^>^> 接下来,您将会调试秒表, 我们将会为您进行系统标准计时...
  102. echo.
  103. echo.    ^>^> 我们会为你进行延时五秒,请您准备好您的计时设备...
  104. echo.
  105. echo.    ^>^> 请将您的计时设备置于您的电子计算机左侧, 打开计时设备但
  106. echo.
  107. echo.    ^>^> 不要开始计时, 请注意, 您按下回车键或空格键之后Hope计时
  108. echo.
  109. echo.    ^>^> 器将开始计时, 您应当同时启动Hope计时器与您的设备...
  110. echo.
  111. echo.    ^>^> 当Hope计时器的窗体变红时, 您应当停止您的计时设备, 按下
  112. echo.
  113. echo.    ^>^> 回车键, 并填写读数, Hope计时器会为您自动校准...
  114. pause > nul
  115. mode con cols=68 lines=5
  116. for /l %%i in (1,1,50) do (
  117. cls
  118. echo.
  119. echo.
  120. echo.    ^>^> %%i00 毫秒 / 5000 毫秒
  121. call :Sleep 100
  122. )
  123. color 4e
  124. cls
  125. echo.
  126. echo.
  127. echo.    ^>^> 请按回车键开始输入读数
  128. pause > nul
  129. cls
  130. echo.
  131. echo.
  132. set /p Math=    ^>^> 请输入读数:
  133. call :VisualSet Result 5/%Math%
  134. call :VisualSet Result 100*%Result%
  135. Md Logs >nul 2>nul
  136. echo.%Result% > Logs\Time.ini
  137. color 0f
  138. cls
  139. echo.
  140. echo.
  141. echo.    ^>^> 请按回车键退出本程序, 退出后, 请您重启本程序...
  142. pause > nul
  143. exit
  144. :VisualSet
  145. @echo off
  146. echo X=%~2>>VisualSet.vbs
  147. echo wscript.echo(X)>>VisualSet.vbs
  148. for /f %%a in ('cscript //nologo VisualSet.vbs') do set %1=%%a
  149. if exist VisualSet.vbs del VisualSet.vbs
  150. goto :eof
  151. :Echo_Debugging
  152. mode con cols=68 lines=34
  153. cls
  154. echo.
  155. echo.  Hope计时器[调试程序]
  156. set /p Str=--------------------------------------------------------------------<nul
  157. echo.
  158. echo.
  159. @goto :eof
  160. :Task
  161. mode con cols=68 lines=34
  162. Md Tasks >nul 2>nul
  163. cls
  164. title Hope计时器[计划程序]
  165. set Error=0
  166. echo.
  167. echo.  Hope计时器[计划程序]
  168. set /p Str=--------------------------------------------------------------------<nul
  169. echo.
  170. echo.
  171. echo.    ^>^> Q 新建计划   W 使用计划   D 删除计划   E 返回菜单   R 退出
  172. if not exist Tasks\*.Htd (
  173. echo.
  174. echo.    ^>^> 当前没有计划
  175. set /p Str=--------------------------------------------------------------------<nul
  176. echo.
  177. echo.
  178. )
  179. if not exist Tasks\Htd.Hdat echo.10000 > Tasks\Htd.Hdat
  180. if exist Tasks\*.Htd (
  181. cd Tasks
  182. echo.
  183. echo.    ^>^> 当前计划列表
  184. set /p Str=--------------------------------------------------------------------<nul
  185. echo.
  186. echo.
  187. for /f %%i in ('dir /b *.Htd') do (
  188. for /f "skip=5" %%j in (%%~ni.Htd) do echo.    ^>^> 编号:%%~ni  备注:%%j
  189. )
  190. echo.
  191. cd..
  192. )
  193. )
  194. call :get_key
  195. if /i "!key!"=="E" (
  196. @goto :Main
  197. )
  198. if /i "!key!"=="D" (
  199. @goto :Del
  200. )
  201. if /i "!key!"=="R" (
  202. exit
  203. )
  204. if /i "!key!"=="Q" (
  205. @goto :New
  206. )
  207. if /i "!key!"=="W" (
  208. @goto :Open
  209. )
  210. if /i "!valid_key!" equ "0" @goto :Task
  211. :Open
  212. if exist Tasks\*.Htd (
  213. set "Content= "
  214. set /p Content=    ^>^> 请输入计划编号:
  215. goto Open_2
  216. ) else cd..&@goto :Task
  217. :Del
  218. if exist Tasks\*.Htd (
  219. set "Content= "
  220. set /p Content=    ^>^> 请输入计划编号:
  221. goto Del_2
  222. ) else cd..&@goto :Task
  223. :Del_2
  224. cd Tasks
  225. if exist %Content%.Htd (
  226. del %Content%.Htd
  227. cd..
  228. goto Task
  229. ) else cd..&goto Task
  230. :Open_2
  231. cd Tasks
  232. if exist %Content%.Htd (
  233. call :Read %Content%
  234. cd..
  235. mode con cols=68 lines=5
  236. @goto :Start
  237. ) else cd..&goto Task
  238. :New
  239. cd Tasks
  240. < Htd.Hdat (
  241. set /p Num=
  242. )
  243. set /a Num+=1
  244. echo.%Num% > Htd.Hdat
  245. cd..
  246. echo.
  247. echo.    ^>^> 新建计划:%Num%
  248. echo.
  249. set "Content=时间到!!!"
  250. set /p Content=    ^>^> 备注:
  251. echo.
  252. set "Content=%Content:>=^>%"
  253. set "Content=%Content:<=^<%"
  254. set "Content=%Content:|=^|%"
  255. set "Title= "
  256. set /p Title=    ^>^> 到时提醒:
  257. echo.
  258. set "Title=%Title:>=^^^>%"
  259. set "Title=%Title:<=^^^<%"
  260. set "Title=%Title:|=^^^|%"
  261. set H=0
  262. set Min=0
  263. set S=0
  264. set H_2=0
  265. set Min_2=0
  266. set S_2=0
  267. set Ms=0
  268. set Ms_2=0
  269. call :Vbs_Sleep 1000
  270. @goto :New_2
  271. :Read
  272. < %1.Htd (
  273. set /p H=
  274. set /p Min=
  275. set /p S=
  276. set /p Ms_2=
  277. set /p Title=
  278. set /p Content=
  279. )
  280. @goto :eof
  281. :New_2
  282. cls
  283. echo.
  284. echo.    ^>^> 当前计时时间:%H%小时%Min%分钟%S%秒
  285. echo.
  286. echo.  Q/W 小时加/减   E/R 分钟加/减   T/Y 秒加/减   U 完成计划
  287. echo.
  288. call :get_key
  289. call :Settings_Time
  290. if /i "!key!"=="U" (
  291. (
  292. echo.%H%
  293. echo.%Min%
  294. echo.%S%
  295. echo.%Ms_2%
  296. echo.%Title%
  297. echo.%Content%
  298. ) > Tasks\%Num%.Htd
  299. @goto :Task
  300. )
  301. if /i "!valid_key!" equ "0" @goto :New_2
  302. :Error
  303. color 1f
  304. cls
  305. echo.
  306. echo.    ^>^> Sleep.exe 和 Sleep.com 不知到何处去了...
  307. echo.
  308. echo.    ^>^> 正在帮您恢复
  309. call :Sleep_Installs
  310. goto :Restart
复制代码

TOP

版本1.0.0016下半部分
  1. :Start
  2. set Error=0
  3. cls
  4. title 计时器[%H_2%小时%Min_2%分钟%S_2%秒/%H%小时%Min%分钟%S%秒]
  5. echo.
  6. echo.    ^>^> %H_2%小时%Min_2%分钟%S_2%秒%Ms%毫秒/%H%小时%Min%分钟%S%秒
  7. echo.
  8. echo.    ^>^> Ctrl+C暂停或退出...
  9. call :Sleep %Time%
  10. if %Error%==1 goto :Error
  11. set /a Ms+=100
  12. if %Ms%==1000 set /a S_2+=1&set Ms=0
  13. if %S_2% Geq 60 set /a Min_2+=1&set S_2=0
  14. if %Min_2% Geq 60 set /a H_2+=1&set Min_2=0
  15. if %H_2% Geq %H% if %Min_2% Geq %Min% if %S_2% Geq %S% goto :End
  16. if /i "!valid_key!" equ "0" goto :Start
  17. :End
  18. cls
  19. color 4e
  20. title 计时器[%H_2%小时%Min_2%分钟%S_2%秒/%H%小时%Min%分钟%S%秒]
  21. Call :Msg "%Title%" vbExclamation "Hope计时器"
  22. color 0f
  23. @call :Restart
  24. @goto :Main
  25. :Vbs_Sleep
  26. echo.Wscript.Sleep %1 > Sleep.vbs
  27. call Sleep.vbs > nul
  28. if exist ReturnKey.vbs del ReturnKey.vbs
  29. @goto :eof
  30. :Sleep_Installs
  31. color 0f
  32. (
  33. echo.-----BEGIN CERTIFICATE-----
  34. echo.TVpQAQEAAAAEAAAA//8AAFABAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  35. echo.AAAAAAAAAAAAAAAAkAAAAPy+gQAPtkz/ZjHSZjHASXggrCwwchQ8CXcQZmvSCmYB
  36. echo.wi7HBi8AMQDr5C7/Ji8ADgBmadLoAwAAZonRZsHpELSGzRW4AEzNIQAAAAAAAAAA
  37. echo.UEUAAEwBAQBQeaU2AAAAAAAAAADgAA8BCwEFDAACAAAAAAAAAAAAAH4QAAAAEAAA
  38. echo.ACAAAAAAQAAAEAAAAAIAAAQAAAAAAAAABAAAAAAAAAAAIAAAAAIAAAAAAAADAAAA
  39. echo.AAAQAAAQAAAAABAAABAAAAAAAAAQAAAAAAAAAAAAAAAQEAAAKAAAAAAAAAAAAAAA
  40. echo.AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  41. echo.AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAABAAAAAAAAAAAAAAAAAAAAAAAAAA
  42. echo.AAAAAAAAAAAudGV4dAAAANwAAAAAEAAAAAIAAAACAAAAAAAAAAAAAAAAAAAgAADg
  43. echo.AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  44. echo.AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABWEAAAZBAAAHYQAAAAAAAA
  45. echo.RhAAAAAAAAAAAAAAOBAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEtFUk5FTDMy
  46. echo.LmRsbAAAVhAAAGQQAAB2EAAAAAAAAAAARXhpdFByb2Nlc3MAAABHZXRDb21tYW5k
  47. echo.TGluZUEAAABTbGVlcAD/FQQQQAAx0khAgDgAdBGAOCJ1AvfSCdJ174A4IHXqQPyJ
  48. echo.xjHSMcCsCMB0IywwchU8CXcRa9IKAcLHBckQQADNEEAA6+L/JckQQAClEEAAUv8V
  49. echo.CBBAAGoA/xUAEEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  50. echo.AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  51. echo.AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  52. echo.AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  53. echo.AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  54. echo.AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  55. echo.AAAAAAAAAAAAAAAAAAAAAA==
  56. echo.-----END CERTIFICATE-----
  57. ) > Sleep.com
  58. Certutil -Decode Sleep.com Sleep.exe > nul
  59. Certutil -Decode -f Sleep.com Sleep.com > nul
  60. goto :eof
  61. :Sleep
  62. set Error=0
  63. if exist Sleep.exe (
  64. Sleep.exe %1
  65. goto :eof
  66. )
  67. if not exist Sleep.exe if exist Sleep.com (
  68. Sleep.com %1
  69. goto :eof
  70. )
  71. if not exist Sleep.exe if not exist Sleep.com (
  72. set Error=1
  73. goto :eof
  74. )
  75. :get_key
  76. rem 用法:call :get_key
  77. set "key="
  78.   for /f "delims=" %%a in ('xcopy /w "%~f0" "%~f0" 2^>nul') do if not defined key set "key=%%a"
  79.   set "key=%key:~-1%"
  80.   set "valid_key=0"
  81. goto :eof
  82. :Msg
  83. Rem 用法: Call :Msg "Text" [buttons] "Title"
  84. echo.Msg=msgbox("%~1",%2,"%~3") > ReturnKey.vbs
  85. Call ReturnKey.vbs > nul
  86. if exist ReturnKey.vbs del ReturnKey.vbs
  87. goto :eof
  88. :Settings_Time
  89. if %Ms_2% Leq 200000000 if %H% geq 0 if %Min% Geq 0 if %S% Geq 0 (
  90. if /i "!key!"=="q" (
  91. set /a Ms_2+=3600000
  92. set /a H+=1
  93. )
  94. if /i "!key!"=="w" (
  95. set /a Ms_2-=3600000
  96. set /a H-=1
  97. )
  98. if /i "!key!"=="e" (
  99. set /a Ms_2+=60000
  100. set /a Min+=1
  101. )
  102. if /i "!key!"=="r" (
  103. set /a Ms_2-=60000
  104. set /a Min-=1
  105. )
  106. if /i "!key!"=="t" (
  107. set /a Ms_2+=1000
  108. set /a S+=1
  109. )
  110. if /i "!key!"=="y" (
  111. set /a Ms_2-=1000
  112. set /a S-=1
  113. )
  114. )
  115. if %S% Lss 0 (
  116. if %Min% Geq 0 if %H% Geq 0 (
  117. set /a Min-=1&set /a S+=60
  118. )
  119. if %Min% Leq 0 if %H% Leq 0 (
  120. echo.
  121. echo.    ^>^> 算数错误!
  122. call :Vbs_Sleep 100
  123. @call :Restart
  124. )
  125. )
  126. if %Min% Lss 0 (
  127. if %H% Gtr 0 set /a H-=1&set /a Min+=60
  128. if %H% Leq 0 (
  129. echo.
  130. echo.    ^>^> 算数错误!
  131. call :Vbs_Sleep 100
  132. @call :Restart
  133. )
  134. )
  135. if %H% Lss 0 (
  136. echo.
  137. echo.    ^>^> 算数错误!
  138. call :Vbs_Sleep 100
  139. @call :Restart
  140. )
  141. if %Ms_2% Gtr 200000000 (
  142. echo.
  143. echo.    ^>^> 算数错误!
  144. call :Vbs_Sleep 100
  145. @call :Restart
  146. )
  147. if %S% Geq 60 set /a Min+=1&set S=0
  148. if %Min% Geq 60 set /a H+=1&set Min=0
复制代码

TOP

本帖最后由 cmd1152 于 2021-8-13 14:01 编辑

回复 40# HOPE2021


    1.0.0017上半部分
  1. @echo off
  2. if not exist Logs\Time.ini set Time=100
  3. if exist Logs\Time.ini (
  4. cd Logs
  5. < Time.ini (
  6. set /p Time=
  7. )
  8. cd..
  9. )
  10. mode con cols=68 lines=5
  11. color f9
  12. endlocal
  13. setlocal enabledelayedexpansion
  14. chcp 936 > nul
  15. Rem By Hope2021
  16. title Hope计时器
  17. cls
  18. echo.
  19. echo.
  20. echo.                                HOPE
  21. call :Vbs_Sleep 1000
  22. call :Sleep_Installs
  23. @call :Restart
  24. @goto :Main
  25. :Restart
  26. color 0f
  27. cls
  28. set H=0
  29. set Min=0
  30. set S=0
  31. set H_2=0
  32. set Min_2=0
  33. set S_2=0
  34. set Ms=0
  35. set Ms_2=0
  36. @goto :eof
  37. :Main
  38. mode con cols=68 lines=7
  39. title Hope计时器
  40. set Error=0
  41. cls
  42. echo.
  43. echo.    ^>^> 当前计时时间:%H%小时%Min%分钟%S%秒
  44. echo.
  45. echo.  Q/W 小时加/减   E/R 分钟加/减   T/Y 秒加/减   U/I 开始计时//退出
  46. echo.
  47. echo.  P 打开计划程序  S 删除计划存储  X 调试
  48. call :get_key
  49. call :Settings_Time
  50. if /i "!key!"=="P" (
  51. set St_1=10001
  52. set En_1=10010
  53. @goto :Task
  54. )
  55. if /i "!key!"=="u" (
  56. mode con cols=68 lines=5
  57. set "Title=时间到!!!"
  58. @goto :Start
  59. )
  60. if /i "!key!"=="x" (
  61. mode con cols=68 lines=34
  62. @goto :Debugging
  63. )
  64. if /i "!key!"=="s" (
  65. rd /s /q tasks
  66. )
  67. if /i "!key!"=="i" (
  68. del sleep.com sleep.exe sleep.vbs
  69. exit
  70. )
  71. if /i "!valid_key!" equ "0" goto :Main
  72. :Debugging
  73. echo.
  74. call :Echo_Debugging
  75. echo.    ^>^> 此向导将会帮助您调试您的设备是否适合运行 Hope (R) 计时器
  76. echo.
  77. echo.    ^>^> 请按回车键开始第一项检查...
  78. echo.
  79. pause > nul
  80. echo.
  81. call :Echo_Debugging
  82. echo.    ^>^> 正在调试 Certutil 性能...
  83. echo.
  84. echo.    ^>^> 请稍等...
  85. echo.
  86. echo.1 > ReturnKey.ini
  87. Certutil -encode ReturnKey.ini Hope.ini > nul
  88. if not exist Hope.ini (
  89. echo.    ^>^> 您的操作系统与 Certutil 不兼容, 无法运行Hope计时器...
  90. echo.
  91. echo.    ^>^> 请按回车键退出...
  92. pause > nul
  93. exit
  94. )
  95. if exist ReturnKey.ini del ReturnKey.ini
  96. if exist Hope.ini del Hope.ini
  97. echo.    ^>^> 您的操作系统与 Certutil 兼容, 可以运行Hope计时器...
  98. echo.
  99. echo.    ^>^> 请按回车键继续...
  100. pause > nul
  101. call :Echo_Debugging
  102. echo.    ^>^> 正在安装延时程序,请稍等...
  103. echo.
  104. call :Sleep_Installs
  105. echo.    ^>^> 接下来,您将会调试秒表, 我们将会为您进行系统标准计时...
  106. echo.
  107. echo.    ^>^> 我们会为你进行延时五秒,请您准备好您的计时设备...
  108. echo.
  109. echo.    ^>^> 请将您的计时设备置于您的电子计算机左侧, 打开计时设备但
  110. echo.
  111. echo.    ^>^> 不要开始计时, 请注意, 您按下回车键或空格键之后Hope计时
  112. echo.
  113. echo.    ^>^> 器将开始计时, 您应当同时启动Hope计时器与您的设备...
  114. echo.
  115. echo.    ^>^> 当Hope计时器的窗体变红时, 您应当停止您的计时设备, 按下
  116. echo.
  117. echo.    ^>^> 回车键, 并填写读数, Hope计时器会为您自动校准...
  118. pause > nul
  119. mode con cols=68 lines=5
  120. for /l %%i in (1,1,50) do (
  121. cls
  122. echo.
  123. echo.
  124. echo.    ^>^> %%i00 毫秒 / 5000 毫秒
  125. call :Sleep 100
  126. )
  127. color 4e
  128. cls
  129. echo.
  130. echo.
  131. echo.    ^>^> 请按回车键开始输入读数
  132. pause > nul
  133. cls
  134. echo.
  135. echo.
  136. set /p Math=    ^>^> 请输入读数:
  137. call :VisualSet Result 5/%Math%
  138. call :VisualSet Result 100*%Result%
  139. Md Logs >nul 2>nul
  140. echo.%Result% > Logs\Time.ini
  141. color 0f
  142. cls
  143. echo.
  144. echo.
  145. echo.    ^>^> 请按回车键退出本程序, 退出后, 请您重启本程序...
  146. pause > nul
  147. exit
  148. :VisualSet
  149. @echo off
  150. echo X=%~2>>VisualSet.vbs
  151. echo wscript.echo(X)>>VisualSet.vbs
  152. for /f %%a in ('cscript //nologo VisualSet.vbs') do set %1=%%a
  153. if exist VisualSet.vbs del VisualSet.vbs
  154. goto :eof
  155. :Echo_Debugging
  156. mode con cols=68 lines=34
  157. cls
  158. echo.
  159. echo.  Hope计时器[调试程序]
  160. set /p Str=--------------------------------------------------------------------<nul
  161. echo.
  162. echo.
  163. @goto :eof
  164. :Task
  165. mode con cols=68 lines=34
  166. Md Tasks >nul 2>nul
  167. cls
  168. title Hope计时器[计划程序]
  169. set Error=0
  170. echo.
  171. echo.  Hope计时器[计划程序]
  172. set /p Str=--------------------------------------------------------------------<nul
  173. echo.
  174. echo.
  175. echo.    ^>^> Q 新建计划   W 使用计划   D 删除计划   E 返回菜单   R 退出
  176. if not exist Tasks\*.Htd (
  177. echo.
  178. echo.    ^>^> 当前没有计划
  179. set /p Str=--------------------------------------------------------------------<nul
  180. echo.
  181. echo.
  182. )
  183. if not exist Tasks\Htd.Hdat echo.10000 > Tasks\Htd.Hdat
  184. if exist Tasks\*.Htd (
  185. cd Tasks
  186. echo.
  187. echo.    ^>^> 当前计划列表
  188. set /p Str=--------------------------------------------------------------------<nul
  189. echo.
  190. echo.
  191. for /f %%i in ('dir /b *.Htd') do (
  192. for /f "skip=5" %%j in (%%~ni.Htd) do echo.    ^>^> 编号:%%~ni  备注:%%j
  193. )
  194. echo.
  195. cd..
  196. )
  197. )
  198. call :get_key
  199. if /i "!key!"=="E" (
  200. @goto :Main
  201. )
  202. if /i "!key!"=="D" (
  203. @goto :Del
  204. )
  205. if /i "!key!"=="R" (
  206. del sleep.com sleep.exe sleep.vbs
  207. exit
  208. )
  209. if /i "!key!"=="Q" (
  210. @goto :New
  211. )
  212. if /i "!key!"=="W" (
  213. @goto :Open
  214. )
  215. if /i "!valid_key!" equ "0" @goto :Task
  216. :Open
  217. if exist Tasks\*.Htd (
  218. set "Content= "
  219. set /p Content=    ^>^> 请输入计划编号:
  220. goto Open_2
  221. ) else cd..&@goto :Task
  222. :Del
  223. if exist Tasks\*.Htd (
  224. set "Content= "
  225. set /p Content=    ^>^> 请输入计划编号:
  226. goto Del_2
  227. ) else cd..&@goto :Task
  228. :Del_2
  229. cd Tasks
  230. if exist %Content%.Htd (
  231. del %Content%.Htd
  232. cd..
  233. goto Task
  234. ) else cd..&goto Task
  235. :Open_2
  236. cd Tasks
  237. if exist %Content%.Htd (
  238. call :Read %Content%
  239. cd..
  240. mode con cols=68 lines=5
  241. @goto :Start
  242. ) else cd..&goto Task
  243. :New
  244. cd Tasks
  245. < Htd.Hdat (
  246. set /p Num=
  247. )
  248. set /a Num+=1
  249. echo.%Num% > Htd.Hdat
  250. cd..
  251. echo.
  252. echo.    ^>^> 新建计划:%Num%
  253. echo.
  254. set "Content=时间到!!!"
  255. set /p Content=    ^>^> 备注:
  256. echo.
  257. set "Content=%Content:>=^>%"
  258. set "Content=%Content:<=^<%"
  259. set "Content=%Content:|=^|%"
  260. set "Title= "
  261. set /p Title=    ^>^> 到时提醒:
  262. echo.
  263. set "Title=%Title:>=^^^>%"
  264. set "Title=%Title:<=^^^<%"
  265. set "Title=%Title:|=^^^|%"
  266. set H=0
  267. set Min=0
  268. set S=0
  269. set H_2=0
  270. set Min_2=0
  271. set S_2=0
  272. set Ms=0
  273. set Ms_2=0
  274. call :Vbs_Sleep 1000
  275. @goto :New_2
  276. :Read
  277. < %1.Htd (
  278. set /p H=
  279. set /p Min=
  280. set /p S=
  281. set /p Ms_2=
  282. set /p Title=
  283. set /p Content=
  284. )
  285. @goto :eof
  286. :New_2
  287. cls
  288. echo.
  289. echo.    ^>^> 当前计时时间:%H%小时%Min%分钟%S%秒
  290. echo.
  291. echo.  Q/W 小时加/减   E/R 分钟加/减   T/Y 秒加/减   U 完成计划
  292. echo.
  293. call :get_key
  294. call :Settings_Time
  295. if /i "!key!"=="U" (
  296. (
  297. echo.%H%
  298. echo.%Min%
  299. echo.%S%
  300. echo.%Ms_2%
  301. echo.%Title%
  302. echo.%Content%
  303. ) > Tasks\%Num%.Htd
  304. @goto :Task
  305. )
  306. if /i "!valid_key!" equ "0" @goto :New_2
  307. :Error
  308. color 1f
  309. cls
  310. echo.
  311. echo.    ^>^> Sleep.exe 和 Sleep.com 不知到何处去了...
  312. echo.
  313. echo.    ^>^> 正在帮您恢复
  314. call :Sleep_Installs
  315. goto :Restart
  316. :Start
  317. set Error=0
  318. cls
  319. title 计时器[%H_2%小时%Min_2%分钟%S_2%秒/%H%小时%Min%分钟%S%秒]
  320. echo.
  321. echo.    ^>^> %H_2%小时%Min_2%分钟%S_2%秒%Ms%毫秒/%H%小时%Min%分钟%S%秒
  322. echo.
  323. echo.    ^>^> Ctrl+C暂停或退出...
  324. call :Sleep %Time%
  325. if %Error%==1 goto :Error
  326. set /a Ms+=100
  327. if %Ms%==1000 set /a S_2+=1&set Ms=0
  328. if %S_2% Geq 60 set /a Min_2+=1&set S_2=0
  329. if %Min_2% Geq 60 set /a H_2+=1&set Min_2=0
  330. if %H_2% Geq %H% if %Min_2% Geq %Min% if %S_2% Geq %S% goto :End
  331. if /i "!valid_key!" equ "0" goto :Start
  332. :End
  333. cls
  334. color 4e
  335. title 计时器[%H_2%小时%Min_2%分钟%S_2%秒/%H%小时%Min%分钟%S%秒]
  336. Call :Msg "%Title%" vbExclamation "Hope计时器"
  337. color 0f
  338. @call :Restart
  339. @goto :Main
  340. :Vbs_Sleep
  341. echo.Wscript.Sleep %1 > Sleep.vbs
  342. call Sleep.vbs > nul
  343. if exist ReturnKey.vbs del ReturnKey.vbs
  344. @goto :eof
  345. :Sleep_Installs
  346. color 0f
  347. (
  348. echo.-----BEGIN CERTIFICATE-----
  349. echo.TVpQAQEAAAAEAAAA//8AAFABAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  350. echo.AAAAAAAAAAAAAAAAkAAAAPy+gQAPtkz/ZjHSZjHASXggrCwwchQ8CXcQZmvSCmYB
  351. echo.wi7HBi8AMQDr5C7/Ji8ADgBmadLoAwAAZonRZsHpELSGzRW4AEzNIQAAAAAAAAAA
  352. echo.UEUAAEwBAQBQeaU2AAAAAAAAAADgAA8BCwEFDAACAAAAAAAAAAAAAH4QAAAAEAAA
  353. echo.ACAAAAAAQAAAEAAAAAIAAAQAAAAAAAAABAAAAAAAAAAAIAAAAAIAAAAAAAADAAAA
  354. echo.AAAQAAAQAAAAABAAABAAAAAAAAAQAAAAAAAAAAAAAAAQEAAAKAAAAAAAAAAAAAAA
  355. echo.AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  356. echo.AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAABAAAAAAAAAAAAAAAAAAAAAAAAAA
  357. echo.AAAAAAAAAAAudGV4dAAAANwAAAAAEAAAAAIAAAACAAAAAAAAAAAAAAAAAAAgAADg
  358. echo.AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  359. echo.AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABWEAAAZBAAAHYQAAAAAAAA
  360. echo.RhAAAAAAAAAAAAAAOBAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEtFUk5FTDMy
  361. echo.LmRsbAAAVhAAAGQQAAB2EAAAAAAAAAAARXhpdFByb2Nlc3MAAABHZXRDb21tYW5k
  362. echo.TGluZUEAAABTbGVlcAD/FQQQQAAx0khAgDgAdBGAOCJ1AvfSCdJ174A4IHXqQPyJ
  363. echo.xjHSMcCsCMB0IywwchU8CXcRa9IKAcLHBckQQADNEEAA6+L/JckQQAClEEAAUv8V
  364. echo.CBBAAGoA/xUAEEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  365. echo.AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  366. echo.AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  367. echo.AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  368. echo.AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  369. echo.AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  370. echo.AAAAAAAAAAAAAAAAAAAAAA==
  371. echo.-----END CERTIFICATE-----
  372. ) > Sleep.com
  373. Certutil -Decode Sleep.com Sleep.exe > nul
  374. Certutil -Decode -f Sleep.com Sleep.com > nul
  375. goto :eof
  376. :Sleep
  377. set Error=0
  378. if exist Sleep.exe (
  379. Sleep.exe %1
  380. goto :eof
  381. )
  382. if not exist Sleep.exe if exist Sleep.com (
  383. Sleep.com %1
  384. goto :eof
  385. )
  386. if not exist Sleep.exe if not exist Sleep.com (
  387. set Error=1
  388. goto :eof
  389. )
  390. :get_key
  391. rem 用法:call :get_key
  392. set "key="
  393.   for /f "delims=" %%a in ('xcopy /w "%~f0" "%~f0" 2^>nul') do if not defined key set "key=%%a"
  394.   set "key=%key:~-1%"
  395.   set "valid_key=0"
  396. goto :eof
  397. :Msg
  398. Rem 用法: Call :Msg "Text" [buttons] "Title"
  399. echo.Msg=msgbox("%~1",%2,"%~3") > ReturnKey.vbs
  400. Call ReturnKey.vbs > nul
  401. if exist ReturnKey.vbs del ReturnKey.vbs
  402. goto :eof
复制代码
梦依旧在,只是,心有余而力渐有不足
年年岁岁花相似,岁岁年年人不同

TOP

1.0.0017下半部分
  1. :Settings_Time
  2. if %Ms_2% Leq 200000000 if %H% geq 0 if %Min% Geq 0 if %S% Geq 0 (
  3. if /i "!key!"=="q" (
  4. set /a Ms_2+=3600000
  5. set /a H+=1
  6. )
  7. if /i "!key!"=="w" (
  8. set /a Ms_2-=3600000
  9. set /a H-=1
  10. )
  11. if /i "!key!"=="e" (
  12. set /a Ms_2+=60000
  13. set /a Min+=1
  14. )
  15. if /i "!key!"=="r" (
  16. set /a Ms_2-=60000
  17. set /a Min-=1
  18. )
  19. if /i "!key!"=="t" (
  20. set /a Ms_2+=1000
  21. set /a S+=1
  22. )
  23. if /i "!key!"=="y" (
  24. set /a Ms_2-=1000
  25. set /a S-=1
  26. )
  27. )
  28. if %S% Lss 0 (
  29. if %Min% Geq 0 if %H% Geq 0 (
  30. set /a Min-=1&set /a S+=60
  31. )
  32. if %Min% Leq 0 if %H% Leq 0 (
  33. echo.
  34. echo.    ^>^> 算数错误!
  35. call :Vbs_Sleep 100
  36. @call :Restart
  37. )
  38. )
  39. if %Min% Lss 0 (
  40. if %H% Gtr 0 set /a H-=1&set /a Min+=60
  41. if %H% Leq 0 (
  42. echo.
  43. echo.    ^>^> 算数错误!
  44. call :Vbs_Sleep 100
  45. @call :Restart
  46. )
  47. )
  48. if %H% Lss 0 (
  49. echo.
  50. echo.    ^>^> 算数错误!
  51. call :Vbs_Sleep 100
  52. @call :Restart
  53. )
  54. if %Ms_2% Gtr 200000000 (
  55. echo.
  56. echo.    ^>^> 算数错误!
  57. call :Vbs_Sleep 100
  58. @call :Restart
  59. )
  60. if %S% Geq 60 set /a Min+=1&set S=0
  61. if %Min% Geq 60 set /a H+=1&set Min=0
复制代码
梦依旧在,只是,心有余而力渐有不足
年年岁岁花相似,岁岁年年人不同

TOP

本帖最后由 cmd1152 于 2021-8-13 14:07 编辑

回复 40# HOPE2021


                                                                                                    合作意向?
                                                                                       [No]                         [Yes]
梦依旧在,只是,心有余而力渐有不足
年年岁岁花相似,岁岁年年人不同

TOP

回复 40# HOPE2021


    1.0.0018修改开始画面 上半部分
  1. @echo off
  2. if not exist Logs\Time.ini set Time=100
  3. if exist Logs\Time.ini (
  4. cd Logs
  5. < Time.ini (
  6. set /p Time=
  7. )
  8. cd..
  9. )
  10. mode con cols=68 lines=5
  11. color f9
  12. endlocal
  13. setlocal enabledelayedexpansion
  14. chcp 936 > nul
  15. Rem By Hope2021
  16. title Hope计时器
  17. for /l %%i in (1,1,3) do (
  18. cls
  19. echo.
  20. echo.
  21. echo.                               -HOPE-
  22. ping/n 1 127.1>nul
  23. cls
  24. echo.
  25. echo.
  26. echo.                               \HOPE\
  27. ping/n 1 127.1>nul
  28. cls
  29. echo.
  30. echo.
  31. echo.                               ^|HOPE^|
  32. ping/n 1 127.1>nul
  33. cls
  34. echo.
  35. echo.
  36. echo.                               /HOPE/
  37. ping/n 1 127.1>nul
  38. )
  39. cls
  40. echo.
  41. echo.                                /    /
  42. echo.                               /HOPE/
  43. echo.                              /    /
  44. ping/n 1 127.1>nul
  45. cls
  46. echo.
  47. echo.                                /-  -/
  48. echo.                               /HOPE/
  49. echo.                              /-  -/
  50. ping/n 1 127.1>nul
  51. cls
  52. echo.
  53. echo.                                /----/
  54. echo.                               /HOPE/
  55. echo.                              /----/
  56. ping/n 1 127.1>nul
  57. ping/n 1 127.1>nul
  58. cls
  59. echo.
  60. echo.
  61. echo.
  62. echo.
  63. ping/n 1 127.1>nul
  64. ping/n 1 127.1>nul
  65. cls
  66. echo.
  67. echo.                                /----/
  68. echo.                               /HOPE/
  69. echo.                              /----/
  70. call :Vbs_Sleep 1000
  71. call :Sleep_Installs
  72. @call :Restart
  73. @goto :Main
  74. :Restart
  75. color 0f
  76. cls
  77. set H=0
  78. set Min=0
  79. set S=0
  80. set H_2=0
  81. set Min_2=0
  82. set S_2=0
  83. set Ms=0
  84. set Ms_2=0
  85. @goto :eof
  86. :Main
  87. mode con cols=68 lines=7
  88. title Hope计时器
  89. set Error=0
  90. cls
  91. echo.
  92. echo.    ^>^> 当前计时时间:%H%小时%Min%分钟%S%秒
  93. echo.
  94. echo.  Q/W 小时加/减   E/R 分钟加/减   T/Y 秒加/减   U/I 开始计时//退出
  95. echo.
  96. echo.  P 打开计划程序  S 删除计划存储  X 调试
  97. call :get_key
  98. call :Settings_Time
  99. if /i "!key!"=="P" (
  100. set St_1=10001
  101. set En_1=10010
  102. @goto :Task
  103. )
  104. if /i "!key!"=="u" (
  105. mode con cols=68 lines=5
  106. set "Title=时间到!!!"
  107. @goto :Start
  108. )
  109. if /i "!key!"=="x" (
  110. mode con cols=68 lines=34
  111. @goto :Debugging
  112. )
  113. if /i "!key!"=="s" (
  114. rd /s /q tasks
  115. )
  116. if /i "!key!"=="i" (
  117. del sleep.com sleep.exe sleep.vbs
  118. exit
  119. )
  120. if /i "!valid_key!" equ "0" goto :Main
  121. :Debugging
  122. echo.
  123. call :Echo_Debugging
  124. echo.    ^>^> 此向导将会帮助您调试您的设备是否适合运行 Hope (R) 计时器
  125. echo.
  126. echo.    ^>^> 请按回车键开始第一项检查...
  127. echo.
  128. pause > nul
  129. echo.
  130. call :Echo_Debugging
  131. echo.    ^>^> 正在调试 Certutil 性能...
  132. echo.
  133. echo.    ^>^> 请稍等...
  134. echo.
  135. echo.1 > ReturnKey.ini
  136. Certutil -encode ReturnKey.ini Hope.ini > nul
  137. if not exist Hope.ini (
  138. echo.    ^>^> 您的操作系统与 Certutil 不兼容, 无法运行Hope计时器...
  139. echo.
  140. echo.    ^>^> 请按回车键退出...
  141. pause > nul
  142. exit
  143. )
  144. if exist ReturnKey.ini del ReturnKey.ini
  145. if exist Hope.ini del Hope.ini
  146. echo.    ^>^> 您的操作系统与 Certutil 兼容, 可以运行Hope计时器...
  147. echo.
  148. echo.    ^>^> 请按回车键继续...
  149. pause > nul
  150. call :Echo_Debugging
  151. echo.    ^>^> 正在安装延时程序,请稍等...
  152. echo.
  153. call :Sleep_Installs
  154. echo.    ^>^> 接下来,您将会调试秒表, 我们将会为您进行系统标准计时...
  155. echo.
  156. echo.    ^>^> 我们会为你进行延时五秒,请您准备好您的计时设备...
  157. echo.
  158. echo.    ^>^> 请将您的计时设备置于您的电子计算机左侧, 打开计时设备但
  159. echo.
  160. echo.    ^>^> 不要开始计时, 请注意, 您按下回车键或空格键之后Hope计时
  161. echo.
  162. echo.    ^>^> 器将开始计时, 您应当同时启动Hope计时器与您的设备...
  163. echo.
  164. echo.    ^>^> 当Hope计时器的窗体变红时, 您应当停止您的计时设备, 按下
  165. echo.
  166. echo.    ^>^> 回车键, 并填写读数, Hope计时器会为您自动校准...
  167. pause > nul
  168. mode con cols=68 lines=5
  169. for /l %%i in (1,1,50) do (
  170. cls
  171. echo.
  172. echo.
  173. echo.    ^>^> %%i00 毫秒 / 5000 毫秒
  174. call :Sleep 100
  175. )
  176. color 4e
  177. cls
  178. echo.
  179. echo.
  180. echo.    ^>^> 请按回车键开始输入读数
  181. pause > nul
  182. cls
  183. echo.
  184. echo.
  185. set /p Math=    ^>^> 请输入读数:
  186. call :VisualSet Result 5/%Math%
  187. call :VisualSet Result 100*%Result%
  188. Md Logs >nul 2>nul
  189. echo.%Result% > Logs\Time.ini
  190. color 0f
  191. cls
  192. echo.
  193. echo.
  194. echo.    ^>^> 请按回车键退出本程序, 退出后, 请您重启本程序...
  195. pause > nul
  196. exit
  197. :VisualSet
  198. @echo off
  199. echo X=%~2>>VisualSet.vbs
  200. echo wscript.echo(X)>>VisualSet.vbs
  201. for /f %%a in ('cscript //nologo VisualSet.vbs') do set %1=%%a
  202. if exist VisualSet.vbs del VisualSet.vbs
  203. goto :eof
  204. :Echo_Debugging
  205. mode con cols=68 lines=34
  206. cls
  207. echo.
  208. echo.  Hope计时器[调试程序]
  209. set /p Str=--------------------------------------------------------------------<nul
  210. echo.
  211. echo.
  212. @goto :eof
  213. :Task
  214. mode con cols=68 lines=34
  215. Md Tasks >nul 2>nul
  216. cls
  217. title Hope计时器[计划程序]
  218. set Error=0
  219. echo.
  220. echo.  Hope计时器[计划程序]
  221. set /p Str=--------------------------------------------------------------------<nul
  222. echo.
  223. echo.
  224. echo.    ^>^> Q 新建计划   W 使用计划   D 删除计划   E 返回菜单   R 退出
  225. if not exist Tasks\*.Htd (
  226. echo.
  227. echo.    ^>^> 当前没有计划
  228. set /p Str=--------------------------------------------------------------------<nul
  229. echo.
  230. echo.
  231. )
  232. if not exist Tasks\Htd.Hdat echo.10000 > Tasks\Htd.Hdat
  233. if exist Tasks\*.Htd (
  234. cd Tasks
  235. echo.
  236. echo.    ^>^> 当前计划列表
  237. set /p Str=--------------------------------------------------------------------<nul
  238. echo.
  239. echo.
  240. for /f %%i in ('dir /b *.Htd') do (
  241. for /f "skip=5" %%j in (%%~ni.Htd) do echo.    ^>^> 编号:%%~ni  备注:%%j
  242. )
  243. echo.
  244. cd..
  245. )
  246. )
  247. call :get_key
  248. if /i "!key!"=="E" (
  249. @goto :Main
  250. )
  251. if /i "!key!"=="D" (
  252. @goto :Del
  253. )
  254. if /i "!key!"=="R" (
  255. del sleep.com sleep.exe sleep.vbs
  256. exit
  257. )
  258. if /i "!key!"=="Q" (
  259. @goto :New
  260. )
  261. if /i "!key!"=="W" (
  262. @goto :Open
  263. )
  264. if /i "!valid_key!" equ "0" @goto :Task
  265. :Open
  266. if exist Tasks\*.Htd (
  267. set "Content= "
  268. set /p Content=    ^>^> 请输入计划编号:
  269. goto Open_2
  270. ) else cd..&@goto :Task
  271. :Del
  272. if exist Tasks\*.Htd (
  273. set "Content= "
  274. set /p Content=    ^>^> 请输入计划编号:
  275. goto Del_2
  276. ) else cd..&@goto :Task
  277. :Del_2
  278. cd Tasks
  279. if exist %Content%.Htd (
  280. del %Content%.Htd
  281. cd..
  282. goto Task
  283. ) else cd..&goto Task
  284. :Open_2
  285. cd Tasks
  286. if exist %Content%.Htd (
  287. call :Read %Content%
  288. cd..
  289. mode con cols=68 lines=5
  290. @goto :Start
  291. ) else cd..&goto Task
  292. :New
  293. cd Tasks
  294. < Htd.Hdat (
  295. set /p Num=
  296. )
  297. set /a Num+=1
  298. echo.%Num% > Htd.Hdat
  299. cd..
  300. echo.
  301. echo.    ^>^> 新建计划:%Num%
  302. echo.
  303. set "Content=时间到!!!"
  304. set /p Content=    ^>^> 备注:
  305. echo.
  306. set "Content=%Content:>=^>%"
  307. set "Content=%Content:<=^<%"
  308. set "Content=%Content:|=^|%"
  309. set "Title= "
  310. set /p Title=    ^>^> 到时提醒:
  311. echo.
  312. set "Title=%Title:>=^^^>%"
  313. set "Title=%Title:<=^^^<%"
  314. set "Title=%Title:|=^^^|%"
  315. set H=0
  316. set Min=0
  317. set S=0
  318. set H_2=0
  319. set Min_2=0
  320. set S_2=0
  321. set Ms=0
  322. set Ms_2=0
  323. call :Vbs_Sleep 1000
  324. @goto :New_2
复制代码
梦依旧在,只是,心有余而力渐有不足
年年岁岁花相似,岁岁年年人不同

TOP

回复 40# HOPE2021


    1.0.0018下半部分
  1. :Read
  2. < %1.Htd (
  3. set /p H=
  4. set /p Min=
  5. set /p S=
  6. set /p Ms_2=
  7. set /p Title=
  8. set /p Content=
  9. )
  10. @goto :eof
  11. :New_2
  12. cls
  13. echo.
  14. echo.    ^>^> 当前计时时间:%H%小时%Min%分钟%S%秒
  15. echo.
  16. echo.  Q/W 小时加/减   E/R 分钟加/减   T/Y 秒加/减   U 完成计划
  17. echo.
  18. call :get_key
  19. call :Settings_Time
  20. if /i "!key!"=="U" (
  21. (
  22. echo.%H%
  23. echo.%Min%
  24. echo.%S%
  25. echo.%Ms_2%
  26. echo.%Title%
  27. echo.%Content%
  28. ) > Tasks\%Num%.Htd
  29. @goto :Task
  30. )
  31. if /i "!valid_key!" equ "0" @goto :New_2
  32. :Error
  33. color 1f
  34. cls
  35. echo.
  36. echo.    ^>^> Sleep.exe 和 Sleep.com 不知到何处去了...
  37. echo.
  38. echo.    ^>^> 正在帮您恢复
  39. call :Sleep_Installs
  40. goto :Restart
  41. :Start
  42. set Error=0
  43. cls
  44. title 计时器[%H_2%小时%Min_2%分钟%S_2%秒/%H%小时%Min%分钟%S%秒]
  45. echo.
  46. echo.    ^>^> %H_2%小时%Min_2%分钟%S_2%秒%Ms%毫秒/%H%小时%Min%分钟%S%秒
  47. echo.
  48. echo.    ^>^> Ctrl+C暂停或退出...
  49. call :Sleep %Time%
  50. if %Error%==1 goto :Error
  51. set /a Ms+=100
  52. if %Ms%==1000 set /a S_2+=1&set Ms=0
  53. if %S_2% Geq 60 set /a Min_2+=1&set S_2=0
  54. if %Min_2% Geq 60 set /a H_2+=1&set Min_2=0
  55. if %H_2% Geq %H% if %Min_2% Geq %Min% if %S_2% Geq %S% goto :End
  56. if /i "!valid_key!" equ "0" goto :Start
  57. :End
  58. cls
  59. color 4e
  60. title 计时器[%H_2%小时%Min_2%分钟%S_2%秒/%H%小时%Min%分钟%S%秒]
  61. Call :Msg "%Title%" vbExclamation "Hope计时器"
  62. color 0f
  63. @call :Restart
  64. @goto :Main
  65. :Vbs_Sleep
  66. echo.Wscript.Sleep %1 > Sleep.vbs
  67. call Sleep.vbs > nul
  68. if exist ReturnKey.vbs del ReturnKey.vbs
  69. @goto :eof
  70. :Sleep_Installs
  71. color 0f
  72. (
  73. echo.-----BEGIN CERTIFICATE-----
  74. echo.TVpQAQEAAAAEAAAA//8AAFABAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  75. echo.AAAAAAAAAAAAAAAAkAAAAPy+gQAPtkz/ZjHSZjHASXggrCwwchQ8CXcQZmvSCmYB
  76. echo.wi7HBi8AMQDr5C7/Ji8ADgBmadLoAwAAZonRZsHpELSGzRW4AEzNIQAAAAAAAAAA
  77. echo.UEUAAEwBAQBQeaU2AAAAAAAAAADgAA8BCwEFDAACAAAAAAAAAAAAAH4QAAAAEAAA
  78. echo.ACAAAAAAQAAAEAAAAAIAAAQAAAAAAAAABAAAAAAAAAAAIAAAAAIAAAAAAAADAAAA
  79. echo.AAAQAAAQAAAAABAAABAAAAAAAAAQAAAAAAAAAAAAAAAQEAAAKAAAAAAAAAAAAAAA
  80. echo.AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  81. echo.AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAABAAAAAAAAAAAAAAAAAAAAAAAAAA
  82. echo.AAAAAAAAAAAudGV4dAAAANwAAAAAEAAAAAIAAAACAAAAAAAAAAAAAAAAAAAgAADg
  83. echo.AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  84. echo.AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABWEAAAZBAAAHYQAAAAAAAA
  85. echo.RhAAAAAAAAAAAAAAOBAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEtFUk5FTDMy
  86. echo.LmRsbAAAVhAAAGQQAAB2EAAAAAAAAAAARXhpdFByb2Nlc3MAAABHZXRDb21tYW5k
  87. echo.TGluZUEAAABTbGVlcAD/FQQQQAAx0khAgDgAdBGAOCJ1AvfSCdJ174A4IHXqQPyJ
  88. echo.xjHSMcCsCMB0IywwchU8CXcRa9IKAcLHBckQQADNEEAA6+L/JckQQAClEEAAUv8V
  89. echo.CBBAAGoA/xUAEEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  90. echo.AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  91. echo.AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  92. echo.AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  93. echo.AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  94. echo.AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
  95. echo.AAAAAAAAAAAAAAAAAAAAAA==
  96. echo.-----END CERTIFICATE-----
  97. ) > Sleep.com
  98. Certutil -Decode Sleep.com Sleep.exe > nul
  99. Certutil -Decode -f Sleep.com Sleep.com > nul
  100. goto :eof
  101. :Sleep
  102. set Error=0
  103. if exist Sleep.exe (
  104. Sleep.exe %1
  105. goto :eof
  106. )
  107. if not exist Sleep.exe if exist Sleep.com (
  108. Sleep.com %1
  109. goto :eof
  110. )
  111. if not exist Sleep.exe if not exist Sleep.com (
  112. set Error=1
  113. goto :eof
  114. )
  115. :get_key
  116. rem 用法:call :get_key
  117. set "key="
  118.   for /f "delims=" %%a in ('xcopy /w "%~f0" "%~f0" 2^>nul') do if not defined key set "key=%%a"
  119.   set "key=%key:~-1%"
  120.   set "valid_key=0"
  121. goto :eof
  122. :Msg
  123. Rem 用法: Call :Msg "Text" [buttons] "Title"
  124. echo.Msg=msgbox("%~1",%2,"%~3") > ReturnKey.vbs
  125. Call ReturnKey.vbs > nul
  126. if exist ReturnKey.vbs del ReturnKey.vbs
  127. goto :eof
  128. :Settings_Time
  129. if %Ms_2% Leq 200000000 if %H% geq 0 if %Min% Geq 0 if %S% Geq 0 (
  130. if /i "!key!"=="q" (
  131. set /a Ms_2+=3600000
  132. set /a H+=1
  133. )
  134. if /i "!key!"=="w" (
  135. set /a Ms_2-=3600000
  136. set /a H-=1
  137. )
  138. if /i "!key!"=="e" (
  139. set /a Ms_2+=60000
  140. set /a Min+=1
  141. )
  142. if /i "!key!"=="r" (
  143. set /a Ms_2-=60000
  144. set /a Min-=1
  145. )
  146. if /i "!key!"=="t" (
  147. set /a Ms_2+=1000
  148. set /a S+=1
  149. )
  150. if /i "!key!"=="y" (
  151. set /a Ms_2-=1000
  152. set /a S-=1
  153. )
  154. )
  155. if %S% Lss 0 (
  156. if %Min% Geq 0 if %H% Geq 0 (
  157. set /a Min-=1&set /a S+=60
  158. )
  159. if %Min% Leq 0 if %H% Leq 0 (
  160. echo.
  161. echo.    ^>^> 算数错误!
  162. call :Vbs_Sleep 100
  163. @call :Restart
  164. )
  165. )
  166. if %Min% Lss 0 (
  167. if %H% Gtr 0 set /a H-=1&set /a Min+=60
  168. if %H% Leq 0 (
  169. echo.
  170. echo.    ^>^> 算数错误!
  171. call :Vbs_Sleep 100
  172. @call :Restart
  173. )
  174. )
  175. if %H% Lss 0 (
  176. echo.
  177. echo.    ^>^> 算数错误!
  178. call :Vbs_Sleep 100
  179. @call :Restart
  180. )
  181. if %Ms_2% Gtr 200000000 (
  182. echo.
  183. echo.    ^>^> 算数错误!
  184. call :Vbs_Sleep 100
  185. @call :Restart
  186. )
  187. if %S% Geq 60 set /a Min+=1&set S=0
  188. if %Min% Geq 60 set /a H+=1&set Min=0
复制代码
1

评分人数

梦依旧在,只是,心有余而力渐有不足
年年岁岁花相似,岁岁年年人不同

TOP

返回列表