找回密码
 加入
搜索
查看: 1439|回复: 1

遇到难点了,请教大侠

  [复制链接]
发表于 2008-10-21 14:22:14 | 显示全部楼层 |阅读模式
#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/21  15:12:28就运行不起来了,老出错.除非按两次按扭.可又不想这样.
最好是前面加个选框,可选两个或一个爆炸执行.
难度太大,请教大侠.
 楼主| 发表于 2008-10-21 15:50:35 | 显示全部楼层

顶下

#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


有哪位大侠帮忙下,或给个类似的学习下,需选一个或两个爆炸,再运行,每次倒计时结束后休息系统时间,如选两个,第一个运行完了再运行第二个

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-9-23 11:28 , Processed in 0.080593 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表