Je rencontrre un soucis avec un petit script qui permet de chercher un image.
Code : Tout sélectionner
Case "POS-IMG"
Sleep(500)
$posIMG = $coordonee[$i][1]
$coordonnee2 = StringSplit($posIMG, ":")
$x = $coordonnee2[1]
$y = $coordonnee2[2]
_journalMsg("Recherche d'image")
$bck = waitForImage("IMG/play.png", 10)
If $bck == True Then
MsgBox(0, "", "IMAGE TROUVEE")
Else
MsgBox(0, "", "IMAGE PAS TROUVEE")
EndIf
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
Par coe refait la vérification 2 fois cela ne marche pas et l'image est pas trouvé
CDT