Im trying to click different images that pops up in a flash game but my script isnt working properly.
Sometimes it works the way it should, though sometimes the cursor just moves up to the left corner and stays there for some reason.
What could I be doing wrong?
Heres my code:
#include <ImageSearch.au3>
HotKeySet("{F7}", "Start")
HotKeySet("{ESC}","Stop")
$X = 0
$Y = 0
$X1 = 0
$Y1 = 0
Func Start()
While 1
$Search = _ImageSearch('pic1.bmp',0,$X,$Y,10)
$Search1 = _ImageSearch('pic2.bmp',0,$X,$Y,10)
If $Search = 1 Then
MouseMove($X, $Y,5)
MouseClick("Left")
ElseIf $Search1 = 1 Then
MouseMove($X1, $Y1,5)
MouseClick("Left")
EndIf
Sleep(200)
WEnd
EndFunc
Func Stop()
Exit
EndFunc
While 1
Sleep(200)
WEnd
Also is it possible to recognize "images" that are moving is this, or a similiar way?
Not sure but I think you need to add this line.
Also change this
To this.