时间戳循环语句的运用[已解决]
本帖最后由 tianlong 于 2010-10-28 13:12 编辑#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("", 201, 301, -1, -1, 0,BitOR($WS_EX_TOOLWINDOW,$WS_EX_TOPMOST))
$Radio1 = GUICtrlCreateRadio("", 8, 48, 81, 17)
$Radio2 = GUICtrlCreateRadio("", 8, 72, 81, 17)
$Checkbox1 = GUICtrlCreateCheckbox("Checkbox1", 8, 96, 81, 17)
$Checkbox2 = GUICtrlCreateCheckbox("Checkbox2", 8, 120, 81, 17)
$Checkbox3 = GUICtrlCreateCheckbox("Checkbox3", 8, 144, 81, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
HotKeySet("{PGUP}", "Start")
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Func start()
GUISetState(@SW_HIDE)
While 1
If BitAnd(GUICtrlRead($Checkbox1),$GUI_CHECKED) = $GUI_CHECKED Then
Send("{F2}")
EndIf
IfBitAnd(GUICtrlRead($Radio2),$GUI_CHECKED) = $GUI_CHECKED Then
Send("^{TAB}")
Sleep(500)
Send("{F1}")
Sleep(500)
EndIf
WEnd
EndFunc上述代码怎么能够运用时间戳使它能够在$Checkbox1,和$Radio2同时勾选后达到这样的效果。
就是在脚本正常运行的情况下一直是执行Send("^{TAB}")
Sleep(500)
Send("{F1}")
Sleep(500)
这个操作;与它同时进行的是每当运行时间达到20秒后执行一次Send("{F2}")
求高手帮帮忙,谢谢!{:face (316):} 这个用 AdlibRegister('执行SendF2的函数', 20 * 1000) 更方便 谢谢afan,这个我在帮助里面看了看,前两天看论坛的朋友也发了个这个。但是介绍的不够详细啊,不会用{:face (229):}
能不能麻烦下教教啊?
最好直接放到我上面那个代码里面,谢谢!!! #include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
HotKeySet("{PGUP}", "Start")
GUICreate("", 201, 301, -1, -1, 0, BitOR($WS_EX_TOOLWINDOW, $WS_EX_TOPMOST))
$Radio1 = GUICtrlCreateRadio("Radio1", 8, 48, 81, 17)
$Radio2 = GUICtrlCreateRadio("Radio2", 8, 72, 81, 17)
$Checkbox1 = GUICtrlCreateCheckbox("Checkbox1", 8, 96, 81, 17)
$Checkbox2 = GUICtrlCreateCheckbox("Checkbox2", 8, 120, 81, 17)
$Checkbox3 = GUICtrlCreateCheckbox("Checkbox3", 8, 144, 81, 17)
GUISetState(@SW_SHOW)
While 1
GUIGetMsg()
WEnd
Func start()
AdlibRegister('SendF2', 20 * 1000)
GUISetState(@SW_HIDE)
While 1
If BitAND(GUICtrlRead($Radio2), $GUI_CHECKED) = $GUI_CHECKED Then
Send("^{TAB}")
Sleep(500)
Send("{F1}")
Sleep(500)
EndIf
WEnd
EndFunc ;==>start
Func SendF2()
If BitAND(GUICtrlRead($Checkbox1), $GUI_CHECKED) = $GUI_CHECKED Then Send("{F2}")
EndFunc ;==>SendF2 再次谢谢afan{:face (411):}
页:
[1]