jeudi 2 avril 2015

autoit image mouse doesn't want to move

My problem is sometimes mouse not move on click on object target.



#include <ImageSearch.au3>

HotKeySet("{F7}", "Start")
HotKeySet("{ESC}","Stop")

$X = 0
$Y = 0
$X1 = 0
$Y1 = 0
$X2 = 0
$Y2 = 0
$X3 = 0
$Y3 = 0

Func Start()
While 1
$result = _imagesearch("kage.bmp", 1, $x, $y, 10)
If $result = 1 Then
Sleep (300)
MouseClick("left", $x, $y)
Sleep (12000)
EndIf
$result1 = _imagesearch("kage1.bmp", 1, $x1, $y1, 10)
If $result1 = 1 Then
Sleep (300)
MouseClick("left", $x1, $y1)
Sleep (3000)
EndIf
$result2 = _imagesearch("kage2.bmp", 1, $x2, $y2, 10)
If $result2 = 1 Then
MouseClick("left", $x2, $y2)
Sleep (8000)
EndIf
$result3 = _imagesearch("kage3.bmp", 1, $x3, $y3, 10)
If $result3 = 1 Then
MouseClick("left", $x3, $y3)
Sleep 200
MouseClick("left", $x3, $y3)
Sleep (12000)
EndIf
WEnd
EndFunc

Func Stop()
Exit
EndFunc

While 1
Sleep(200)
WEnd

Aucun commentaire:

Enregistrer un commentaire