LorLard Posted April 25, 2022 Share Posted April 25, 2022 Hello I have this code : while 1 $bck = waitForImage("IMG/blackscreen.png", 10) If $bck Then MsgBox(0, '', "SUCCESS") ExitLoop Else MsgBox(0, "", "NOT FOUND") EndIf WEnd Func waitForImage($imageFile, $waitSecs = 5) Local $timeout = $waitSecs * 1000 Local $startTime = TimerInit() ;loop until image is found, or until wait time is exceeded While true If _ImageSearch($imageFile, 1, 100) <> false Then Return true EndIf If $timeout > 0 And TimerDiff($startTime) >= $timeout Then ExitLoop EndIf sleep(50) WEnd Return False EndFunc When i show a black screen i show success 1x but not 2x if i search again . Why PLZ Link to comment Share on other sites More sharing options...
Developers Jos Posted April 25, 2022 Developers Share Posted April 25, 2022 Bye Yuchan. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Recommended Posts