Hello,
I am currently trying to write a script in autoIT that has a while 1 loop that contains a couple of IF, ElseIf statements. Some of those ElseIf Statements are Pixelsearches that contain Func(s) that contain PixelCheckSum. I Need help with making the script do two things. It only does one of those things right now the way I have it written. I need it to first Pixelsearch, click found pixel, and then wait for the PixelCheckSum to find a Change in some defined Coords. Once it detects that change it can continue with the rest of the code. That's what it does right now. The minor addendum I need is to change the PCS so that it does both:
Wait for a change and once there is a change execute the next step OR
Wait for a change and if there is no change for a desired amount of time then execute the next step that it would've executed had there been a change.
This is the script so far:
Func Start()
While 1
$x = PixelSearch($x1, $y1, $x2, $y2, $color, 1)
$y = PixelSearch($x1, $y1, $x2, $y2, $color1, 1)
$z = PixelSearch($x1, $y1, $x2, $y2, $color2, 1)
If IsArray($y) = True Then
ElseIf IsArray($z) Then
ElseIf IsArray($x) Then
Wait()
EndIf
WEnd
EndFunc
Func Wait()
$Waiting = True
Local $Pix = PixelCheckSum($x3, $y3, $x4, $y4, $Color4, 1)
While ($Pix) = PixelCheckSum($x3, $y3, $x4, $y4, $Color4, 1)
Local $Start = TimerInit()
If Not (@error) Then
$Waiting = False
$End = TimerDiff($Start)
If ($End) > 5000 Then
$Waiting = False
Start()
EndIf
EndIf
WEnd
EndFunc ;==>Wait







