|
Post by Admin on Jun 21, 2014 22:57:06 GMT
Like waiting for a screen pixel to change, you can also wait for a defined area of the screen to change...
$nL = 10 $nT = 10 $nR = 20 $nB = 20
;Get a checksum and pass it to function $Checksum = PixelChecksum($nL, $nT, $nR, $nB)
;Wait for checksum to change or time out after 5 seconds. $NewChecksum = _ChecksumWaitChanged($nL, $nT, $nR, $nB ,$Checksum, 5000) If @error Then MsgBox(0, "Error: " & @error, "Checksum did not change") Exit EndIf
MsgBox(0, "Success", "Checksum changed to " & $NewChecksum)
;########################################################################### ;Waits for the passed checksum of the given area to to change or time out ;########################################################################### Func _ChecksumWaitChanged($l, $t, $r, $b, $cksm, $timeout = 0, $sleep = 100) Local $Timer If $timeout Then $Timer = TimerInit() EndIf Do If $timeout Then If TimerDiff($Timer) >= $timeout Then Return SetError(1, 0, 0) EndIf EndIf Sleep($sleep) Until (PixelChecksum($l, $t, $r, $b) <> $cksm) Return PixelChecksum($l, $t, $r, $b) EndFunc ;==>_ChecksumWaittChanged
|
|