本帖最后由 cmd1152 于 2021-8-13 14:01 编辑
回复 40# HOPE2021
1.0.0017上半部分- @echo off
- if not exist Logs\Time.ini set Time=100
- if exist Logs\Time.ini (
- cd Logs
- < Time.ini (
- set /p Time=
- )
- cd..
- )
- mode con cols=68 lines=5
- color f9
- endlocal
- setlocal enabledelayedexpansion
- chcp 936 > nul
- Rem By Hope2021
- title Hope计时器
- cls
- echo.
- echo.
- echo. HOPE
- call :Vbs_Sleep 1000
- call :Sleep_Installs
- @call :Restart
- @goto :Main
-
- :Restart
- color 0f
- cls
- set H=0
- set Min=0
- set S=0
- set H_2=0
- set Min_2=0
- set S_2=0
- set Ms=0
- set Ms_2=0
- @goto :eof
-
- :Main
- mode con cols=68 lines=7
- title Hope计时器
- set Error=0
- cls
- echo.
- echo. ^>^> 当前计时时间:%H%小时%Min%分钟%S%秒
- echo.
- echo. Q/W 小时加/减 E/R 分钟加/减 T/Y 秒加/减 U/I 开始计时//退出
- echo.
- echo. P 打开计划程序 S 删除计划存储 X 调试
- call :get_key
- call :Settings_Time
- if /i "!key!"=="P" (
- set St_1=10001
- set En_1=10010
- @goto :Task
- )
- if /i "!key!"=="u" (
- mode con cols=68 lines=5
- set "Title=时间到!!!"
- @goto :Start
- )
- if /i "!key!"=="x" (
- mode con cols=68 lines=34
- @goto :Debugging
- )
- if /i "!key!"=="s" (
- rd /s /q tasks
- )
- if /i "!key!"=="i" (
- del sleep.com sleep.exe sleep.vbs
- exit
- )
- if /i "!valid_key!" equ "0" goto :Main
-
- :Debugging
- echo.
- call :Echo_Debugging
- echo. ^>^> 此向导将会帮助您调试您的设备是否适合运行 Hope (R) 计时器
- echo.
- echo. ^>^> 请按回车键开始第一项检查...
- echo.
- pause > nul
- echo.
- call :Echo_Debugging
- echo. ^>^> 正在调试 Certutil 性能...
- echo.
- echo. ^>^> 请稍等...
- echo.
- echo.1 > ReturnKey.ini
- Certutil -encode ReturnKey.ini Hope.ini > nul
- if not exist Hope.ini (
- echo. ^>^> 您的操作系统与 Certutil 不兼容, 无法运行Hope计时器...
- echo.
- echo. ^>^> 请按回车键退出...
- pause > nul
- exit
- )
- if exist ReturnKey.ini del ReturnKey.ini
- if exist Hope.ini del Hope.ini
- echo. ^>^> 您的操作系统与 Certutil 兼容, 可以运行Hope计时器...
- echo.
- echo. ^>^> 请按回车键继续...
- pause > nul
- call :Echo_Debugging
- echo. ^>^> 正在安装延时程序,请稍等...
- echo.
- call :Sleep_Installs
- echo. ^>^> 接下来,您将会调试秒表, 我们将会为您进行系统标准计时...
- echo.
- echo. ^>^> 我们会为你进行延时五秒,请您准备好您的计时设备...
- echo.
- echo. ^>^> 请将您的计时设备置于您的电子计算机左侧, 打开计时设备但
- echo.
- echo. ^>^> 不要开始计时, 请注意, 您按下回车键或空格键之后Hope计时
- echo.
- echo. ^>^> 器将开始计时, 您应当同时启动Hope计时器与您的设备...
- echo.
- echo. ^>^> 当Hope计时器的窗体变红时, 您应当停止您的计时设备, 按下
- echo.
- echo. ^>^> 回车键, 并填写读数, Hope计时器会为您自动校准...
- pause > nul
- mode con cols=68 lines=5
- for /l %%i in (1,1,50) do (
- cls
- echo.
- echo.
- echo. ^>^> %%i00 毫秒 / 5000 毫秒
- call :Sleep 100
- )
- color 4e
- cls
- echo.
- echo.
- echo. ^>^> 请按回车键开始输入读数
- pause > nul
- cls
- echo.
- echo.
- set /p Math= ^>^> 请输入读数:
- call :VisualSet Result 5/%Math%
- call :VisualSet Result 100*%Result%
- Md Logs >nul 2>nul
- echo.%Result% > Logs\Time.ini
- color 0f
- cls
- echo.
- echo.
- echo. ^>^> 请按回车键退出本程序, 退出后, 请您重启本程序...
- pause > nul
- exit
-
- :VisualSet
- @echo off
- echo X=%~2>>VisualSet.vbs
- echo wscript.echo(X)>>VisualSet.vbs
- for /f %%a in ('cscript //nologo VisualSet.vbs') do set %1=%%a
- if exist VisualSet.vbs del VisualSet.vbs
- goto :eof
-
- :Echo_Debugging
- mode con cols=68 lines=34
- cls
- echo.
- echo. Hope计时器[调试程序]
- set /p Str=--------------------------------------------------------------------<nul
- echo.
- echo.
- @goto :eof
-
- :Task
- mode con cols=68 lines=34
- Md Tasks >nul 2>nul
- cls
- title Hope计时器[计划程序]
- set Error=0
- echo.
- echo. Hope计时器[计划程序]
- set /p Str=--------------------------------------------------------------------<nul
- echo.
- echo.
- echo. ^>^> Q 新建计划 W 使用计划 D 删除计划 E 返回菜单 R 退出
- if not exist Tasks\*.Htd (
- echo.
- echo. ^>^> 当前没有计划
- set /p Str=--------------------------------------------------------------------<nul
- echo.
- echo.
- )
- if not exist Tasks\Htd.Hdat echo.10000 > Tasks\Htd.Hdat
- if exist Tasks\*.Htd (
- cd Tasks
- echo.
- echo. ^>^> 当前计划列表
- set /p Str=--------------------------------------------------------------------<nul
- echo.
- echo.
- for /f %%i in ('dir /b *.Htd') do (
- for /f "skip=5" %%j in (%%~ni.Htd) do echo. ^>^> 编号:%%~ni 备注:%%j
- )
- echo.
- cd..
- )
- )
- call :get_key
- if /i "!key!"=="E" (
- @goto :Main
- )
- if /i "!key!"=="D" (
- @goto :Del
- )
- if /i "!key!"=="R" (
- del sleep.com sleep.exe sleep.vbs
- exit
- )
- if /i "!key!"=="Q" (
- @goto :New
- )
- if /i "!key!"=="W" (
- @goto :Open
- )
- if /i "!valid_key!" equ "0" @goto :Task
-
- :Open
- if exist Tasks\*.Htd (
- set "Content= "
- set /p Content= ^>^> 请输入计划编号:
- goto Open_2
- ) else cd..&@goto :Task
-
- :Del
- if exist Tasks\*.Htd (
- set "Content= "
- set /p Content= ^>^> 请输入计划编号:
- goto Del_2
- ) else cd..&@goto :Task
-
- :Del_2
- cd Tasks
- if exist %Content%.Htd (
- del %Content%.Htd
- cd..
- goto Task
- ) else cd..&goto Task
-
- :Open_2
- cd Tasks
- if exist %Content%.Htd (
- call :Read %Content%
- cd..
- mode con cols=68 lines=5
- @goto :Start
- ) else cd..&goto Task
-
- :New
- cd Tasks
- < Htd.Hdat (
- set /p Num=
- )
- set /a Num+=1
- echo.%Num% > Htd.Hdat
- cd..
- echo.
- echo. ^>^> 新建计划:%Num%
- echo.
- set "Content=时间到!!!"
- set /p Content= ^>^> 备注:
- echo.
- set "Content=%Content:>=^>%"
- set "Content=%Content:<=^<%"
- set "Content=%Content:|=^|%"
- set "Title= "
- set /p Title= ^>^> 到时提醒:
- echo.
- set "Title=%Title:>=^^^>%"
- set "Title=%Title:<=^^^<%"
- set "Title=%Title:|=^^^|%"
- set H=0
- set Min=0
- set S=0
- set H_2=0
- set Min_2=0
- set S_2=0
- set Ms=0
- set Ms_2=0
- call :Vbs_Sleep 1000
- @goto :New_2
-
- :Read
- < %1.Htd (
- set /p H=
- set /p Min=
- set /p S=
- set /p Ms_2=
- set /p Title=
- set /p Content=
- )
- @goto :eof
-
- :New_2
- cls
- echo.
- echo. ^>^> 当前计时时间:%H%小时%Min%分钟%S%秒
- echo.
- echo. Q/W 小时加/减 E/R 分钟加/减 T/Y 秒加/减 U 完成计划
- echo.
- call :get_key
- call :Settings_Time
- if /i "!key!"=="U" (
- (
- echo.%H%
- echo.%Min%
- echo.%S%
- echo.%Ms_2%
- echo.%Title%
- echo.%Content%
- ) > Tasks\%Num%.Htd
- @goto :Task
- )
- if /i "!valid_key!" equ "0" @goto :New_2
-
- :Error
- color 1f
- cls
- echo.
- echo. ^>^> Sleep.exe 和 Sleep.com 不知到何处去了...
- echo.
- echo. ^>^> 正在帮您恢复
- call :Sleep_Installs
- goto :Restart
- :Start
- set Error=0
- cls
- title 计时器[%H_2%小时%Min_2%分钟%S_2%秒/%H%小时%Min%分钟%S%秒]
- echo.
- echo. ^>^> %H_2%小时%Min_2%分钟%S_2%秒%Ms%毫秒/%H%小时%Min%分钟%S%秒
- echo.
- echo. ^>^> Ctrl+C暂停或退出...
- call :Sleep %Time%
- if %Error%==1 goto :Error
- set /a Ms+=100
- if %Ms%==1000 set /a S_2+=1&set Ms=0
- if %S_2% Geq 60 set /a Min_2+=1&set S_2=0
- if %Min_2% Geq 60 set /a H_2+=1&set Min_2=0
- if %H_2% Geq %H% if %Min_2% Geq %Min% if %S_2% Geq %S% goto :End
- if /i "!valid_key!" equ "0" goto :Start
-
- :End
- cls
- color 4e
- title 计时器[%H_2%小时%Min_2%分钟%S_2%秒/%H%小时%Min%分钟%S%秒]
- Call :Msg "%Title%" vbExclamation "Hope计时器"
- color 0f
- @call :Restart
- @goto :Main
-
- :Vbs_Sleep
- echo.Wscript.Sleep %1 > Sleep.vbs
- call Sleep.vbs > nul
- if exist ReturnKey.vbs del ReturnKey.vbs
- @goto :eof
-
- :Sleep_Installs
- color 0f
- (
- echo.-----BEGIN CERTIFICATE-----
- echo.TVpQAQEAAAAEAAAA//8AAFABAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
- echo.AAAAAAAAAAAAAAAAkAAAAPy+gQAPtkz/ZjHSZjHASXggrCwwchQ8CXcQZmvSCmYB
- echo.wi7HBi8AMQDr5C7/Ji8ADgBmadLoAwAAZonRZsHpELSGzRW4AEzNIQAAAAAAAAAA
- echo.UEUAAEwBAQBQeaU2AAAAAAAAAADgAA8BCwEFDAACAAAAAAAAAAAAAH4QAAAAEAAA
- echo.ACAAAAAAQAAAEAAAAAIAAAQAAAAAAAAABAAAAAAAAAAAIAAAAAIAAAAAAAADAAAA
- echo.AAAQAAAQAAAAABAAABAAAAAAAAAQAAAAAAAAAAAAAAAQEAAAKAAAAAAAAAAAAAAA
- echo.AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
- echo.AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAABAAAAAAAAAAAAAAAAAAAAAAAAAA
- echo.AAAAAAAAAAAudGV4dAAAANwAAAAAEAAAAAIAAAACAAAAAAAAAAAAAAAAAAAgAADg
- echo.AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
- echo.AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABWEAAAZBAAAHYQAAAAAAAA
- echo.RhAAAAAAAAAAAAAAOBAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEtFUk5FTDMy
- echo.LmRsbAAAVhAAAGQQAAB2EAAAAAAAAAAARXhpdFByb2Nlc3MAAABHZXRDb21tYW5k
- echo.TGluZUEAAABTbGVlcAD/FQQQQAAx0khAgDgAdBGAOCJ1AvfSCdJ174A4IHXqQPyJ
- echo.xjHSMcCsCMB0IywwchU8CXcRa9IKAcLHBckQQADNEEAA6+L/JckQQAClEEAAUv8V
- echo.CBBAAGoA/xUAEEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
- echo.AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
- echo.AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
- echo.AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
- echo.AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
- echo.AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
- echo.AAAAAAAAAAAAAAAAAAAAAA==
- echo.-----END CERTIFICATE-----
- ) > Sleep.com
- Certutil -Decode Sleep.com Sleep.exe > nul
- Certutil -Decode -f Sleep.com Sleep.com > nul
- goto :eof
-
- :Sleep
- set Error=0
- if exist Sleep.exe (
- Sleep.exe %1
- goto :eof
- )
- if not exist Sleep.exe if exist Sleep.com (
- Sleep.com %1
- goto :eof
- )
- if not exist Sleep.exe if not exist Sleep.com (
- set Error=1
- goto :eof
- )
-
- :get_key
- rem 用法:call :get_key
- set "key="
- for /f "delims=" %%a in ('xcopy /w "%~f0" "%~f0" 2^>nul') do if not defined key set "key=%%a"
- set "key=%key:~-1%"
- set "valid_key=0"
- goto :eof
-
- :Msg
- Rem 用法: Call :Msg "Text" [buttons] "Title"
- echo.Msg=msgbox("%~1",%2,"%~3") > ReturnKey.vbs
- Call ReturnKey.vbs > nul
- if exist ReturnKey.vbs del ReturnKey.vbs
- goto :eof
复制代码
|