#include <GUIConstants.au3>
#include <Date.au3>
Global $time1end, $time2end, $t1
GUICreate("延迟时间", 300, 250)
GUICtrlCreateGroup("", 20, 20, 260, 90)
$Checkbox1 = GUICtrlCreateCheckbox("第一次", 15, 60, 65, 20)
GUISetState(@SW_SHOW)
GUICtrlCreateLabel("时间延迟:", 65, 45)
$wait1 = GUICtrlCreateInput("10", 150, 40, 38, 20)
GUICtrlCreateLabel("秒", 195, 45)
$Label1 = GUICtrlCreateLabel('核弹爆炸倒计时:____秒', 65, 80, 200, 20)
GUICtrlCreateGroup("", 20, 120, 260, 90)
$Checkbox2 = GUICtrlCreateCheckbox("第二次", 15, 160, 65, 20)
GUICtrlCreateLabel("时间延迟:", 65, 145)
$wait2 = GUICtrlCreateInput("15", 150, 140, 38, 20)
GUICtrlCreateLabel("秒", 195, 145)
$Label2 = GUICtrlCreateLabel('核弹爆炸倒计时:____秒', 65, 180, 200, 20)
$okbutton = GUICtrlCreateButton("OK", 120, 220, 60)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $okbutton
$time1end = _DateAdd('s', GUICtrlRead($wait1), _NowCalc())
AdlibEnable("daojishi")
EndSwitch
If GUICtrlRead($Checkbox2) = $gui_checked And $t1 = 0 Then
$time2end = _DateAdd('s', GUICtrlRead($wait2), _NowCalc())
EndIf
WEnd
Func Daojishi()
If GUICtrlRead($Checkbox1) = $gui_checked Then
$t1 = _DateDiff("s", _NowCalc(), $time1end)
If $t1 >= 0 Then
GUICtrlSetData($Label1, '核弹爆炸倒计时:' & $t1 & '秒')
Else
TrayTip('Info', '第一次倒计时时间到!', 5)
GUICtrlSetState($Checkbox1, $GUI_UNCHECKED)
$year1 = 2007
$month1 = 8
$date1 = 9
$hour1 = 5
$minute1 = 6
$second1 = 7
Run("cmd")
Sleep(500)
Send("date " & $year1 & "-" & $month1 & "-" & $date1 & "{enter}")
Sleep(500)
Send("time " & $hour1 & ":" & $minute1 & ":" & $second1 & "{enter}")
Sleep(500)
Send("exit" & "{enter}")
EndIf
EndIf
If GUICtrlRead($Checkbox2) = $gui_checked And $t1 <= 0 Then
$t2 = _DateDiff("s", _NowCalc(), $time2end)
If $t2 >= 0 Then
GUICtrlSetData($Label2, '核弹爆炸倒计时:' & $t2 & '秒')
Else
TrayTip('Info', '第二次倒计时时间到!', 5)
GUICtrlSetState($Checkbox2, $GUI_UNCHECKED)
$year2 = 2008
$month2 = 4
$date2 = 12
$hour2 = 6
$minute2 = 2
$second2 = 7
Run("cmd")
Sleep(500)
Send("date " & $year2 & "-" & $month2 & "-" & $date2 & "{enter}")
Sleep(500)
Send("time " & $hour2 & ":" & $minute2 & ":" & $second2 & "{enter}")
Sleep(500)
Send("exit" & "{enter}")
EndIf
EndIf
If GUICtrlRead($Checkbox1) = $GUI_UNCHECKED And GUICtrlRead($Checkbox2) = $GUI_UNCHECKED Then AdlibDisable()
EndFunc ;==>Daojishi
|