-2
我遇到以下代碼有問題。我試圖讓循環保釋,並按下TAB鍵時轉到Setup()函數。但是當我按TAB時什麼都沒有發生,它只是繼續循環,請幫助!AutoIt _IsPressed不要在循環中調用
While -1
While -1
WinActivate($PID)
Sleep(1000)
Send("Hello")
$timer = TimerInit()
While -1
PixelSearch($searchL,$searchT,$searchR,$searchB,"0x" & Hex($color,6),10,1)
---> If _IsPressed("09",$dll) Then ExitLoop 3 ;HERE IS THE CODE THAT IS NOT WORKING
If @error <> 1 Then ExitLoop
If TimerDiff($timer) > 1000 Then
Sleep(1000)
WinActivate($PID)
ExitLoop 2
EndIf
Wend
$timer = TimerInit()
MouseMove($shade[0], $shade[1])
While -1
PixelSearch($shade[0]-10,$shade[1]-10,$shade[0]+10,$shade[1]+10,"0x" & Hex($color,6),10,1)
---> If _IsPressed("09",$dll) Then ExitLoop 3 ;HERE IS THE CODE THAT IS NOT WORKING
If @error = 1 Then ExitLoop
If TimerDiff($timer) > 5000 Then
Sleep(1000)
WinActivate($PID)
Exitloop 2
EndIf
Wend
Wend
Wend
Setup()
EndFunc
你能提供[MCVE](http://stackoverflow.com/help/mcve)嗎? –