Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

Strange MouseClick problem

$
0
0

So last night I wrote a script to find and image and click on, it work perfectly all night while testing. When I woke up this morning it not longer worked for some reason and I have no idea what couldn't changed. The script still finds the image, and right after I post a msgbox to make sure it hits that line of code and returns x,y, but the mouse click never fires

 

It does however fire once if I click back to Scite? But only once since the window is not longer active, it's almost as if there is a setting in Scite that needs focus? Or maybe the window is all of a sudden blocking automated mouse clicks somehow?

 

Any ideas?

AutoIt         
#include <ImageSearch.au3> Opt("MouseCoordMode", 1) $WinName = "TestWindow" $ImageLoc = "z:\dev\Images\TestImage.png" HotKeySet("{F2}", "ClickImage") HotKeySet("x", "Stop") $X= 0 $Y= 0 Main() Func Main()    while 1       sleep(10)       IF WinActive($WinName) Then          ClickImage()       EndIf    wend EndFunc Func ClickImage()   $result = _ImageSearch($ImageLoc ,1,$X,$Y,5)    IF $result=1 Then       MsgBox(0, "", "Found Image at" & $X& ":"& $Y)       MouseMove($X, $Y)       MouseClick("left")    EndIf    Sleep(100) EndFunc Func Stop() ;to allow the script to stop     Exit EndFunc

 


Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>