遇到难点了,请教大侠
#include <GUIConstants.au3>GUICreate("延迟时间", 300, 250)
GUICtrlCreateGroup ("第一次",20,20,260,90)
GUISetState(@SW_SHOW)
GUICtrlCreateLabel("时间延迟:", 60,45)
$wait1=GUICtrlCreateInput("0.002",150,40,38,20)
GUICtrlCreateLabel("小时", 195,45)
$Label = GUICtrlCreateLabel('核弹爆炸倒计时:____秒', 65,80,200,20)
GUICtrlCreateGroup ("第二次",20,120,260,90)
GUICtrlCreateLabel("时间延迟:", 60,145)
$wait2=GUICtrlCreateInput("0.004",150,140,38,20)
GUICtrlCreateLabel("小时", 195,145)
$Labe2 = GUICtrlCreateLabel('核弹爆炸倒计时:____秒', 65,180,200,20)
$okbutton=GUICtrlCreateButton("OK", 120, 220, 60)
Local $bg = 0, $C = 0
While 1
$Msg=GUIGetMsg()
Switch $Msg
Case $GUI_EVENT_CLOSE
Exit
Case $okbutton
$w=GUICtrlRead($wait1)*60*60
$T1 = TimerInit()
$bg = 1
EndSwitch
If $bg = 1 Then
$T2 = Int(TimerDiff($T1) / 1000)
If $T2 >= $w Then ExitLoop
If $T2 > $C Then
$C = $T2
GUICtrlSetData($Label , '核弹爆炸倒计时: ' & $w - $T2 & ' 秒')
EndIf
EndIf
WEnd
我现在单个爆炸后,比如修改系统时间2007/11/25 13:11:18可以执行了.
可在第一个爆炸后修改系统时间2007/11/25 13:11:18后再执行第二个爆炸后再次修改系统时间2008/9/2115:12:28就运行不起来了,老出错.除非按两次按扭.可又不想这样.
最好是前面加个选框,可选两个或一个爆炸执行.
难度太大,请教大侠.
顶下
#include <GUIConstants.au3>GUICreate("延迟时间", 300, 250)
GUICtrlCreateGroup ("",20,20,260,90)
GUICtrlCreateCheckbox("第一次", 15, 60, 65, 20)
GUISetState(@SW_SHOW)
GUICtrlCreateLabel("时间延迟:", 65,45)
$wait1=GUICtrlCreateInput("0.001",150,40,38,20)
GUICtrlCreateLabel("小时", 195,45)
$Label = GUICtrlCreateLabel('核弹爆炸倒计时:____秒', 65,80,200,20)
GUICtrlCreateGroup ("",20,120,260,90)
GUICtrlCreateCheckbox("第二次", 15, 160, 65, 20)
GUICtrlCreateLabel("时间延迟:", 65,145)
$wait2=GUICtrlCreateInput("0.002",150,140,38,20)
GUICtrlCreateLabel("小时", 195,145)
$Labe2 = GUICtrlCreateLabel('核弹爆炸倒计时:____秒', 65,180,200,20)
$okbutton=GUICtrlCreateButton("OK", 120, 220, 60)
Local $bg = 0, $C = 0
While 1
$Msg=GUIGetMsg()
Switch $Msg
Case $GUI_EVENT_CLOSE
Exit
Case $okbutton
$w=GUICtrlRead($wait1)*60*60
$T1 = TimerInit()
$bg = 1
EndSwitch
If $bg = 1 Then
$T2 = Int(TimerDiff($T1) / 1000)
If $T2 >= $w Then ExitLoop
If $T2 > $C Then
$C = $T2
GUICtrlSetData($Label , '核弹爆炸倒计时: ' & $w - $T2 & ' 秒')
EndIf
EndIf
WEnd
Local $bg2 = 0, $C2 = 0
While 2
$Msg2=GUIGetMsg()
Switch $Msg2
Case $GUI_EVENT_CLOSE
Exit
Case $okbutton
$w2=GUICtrlRead($wait2)*60*60
$T3 = TimerInit()
$bg = 1
EndSwitch
If $bg = 1 Then
$T4 = Int(TimerDiff($T3) / 1000)
If $T4 >= $w2 Then ExitLoop
If $T4 > $C2 Then
$C = $T4
GUICtrlSetData($Label , '核弹爆炸倒计时: ' & $w2 - $T4 & ' 秒')
EndIf
EndIf
WEnd
有哪位大侠帮忙下,或给个类似的学习下,需选一个或两个爆炸,再运行,每次倒计时结束后休息系统时间,如选两个,第一个运行完了再运行第二个
页:
[1]