drtrann Posted June 7, 2012 Share Posted June 7, 2012 (edited) hello guys, im sorry that im going to have to post another one of these threads but i've scoured the internet attempting to find out why my imagesearch test isnt functioning. this is literally a copy paste of a functioning example i found but even this doesnt work #include 'ImageSearch.au3' HotKeySet("s", "Start") $x = 0 $y = 0 Func Start() $Search = _ImageSearch('test.JPG',0,$x,$y,0) If $Search=1 Then MouseMove($x,$y,10) Else MsgBox(0,"","fail") EndIf EndFunc while 1 Sleep(100) WEnd as you can see this is an incredibly simple script to look for an icon that resides on my desktop. the image its looking for is 10x10 of the center icon. but it is constantly returning with a fail the only thing i can think of is that the image file is somehow wrong, but i've redone it 5+ times and even tried multiple different ways of executing _ImageSearch, ultimately to the same exact issue. thank you for any help with this issue i do appreciate it Edited June 7, 2012 by drtrann Link to comment Share on other sites More sharing options...
Kidney Posted June 7, 2012 Share Posted June 7, 2012 this is the image search function i always use and it always works if the image is there: _Imagesearcharea("Images/Icon.PNG",1,0,0,@DesktopWidth,@DesktopHeight,$x,$y,100) here are the parameters: Image, returned position (1 = center of the image, 0 = top left corner), Left, top, right, bottom, returned x position, returned y position, tolerance) now, this function searches the whole screen and the image you r using is not one of the supported types. bitmap or png Link to comment Share on other sites More sharing options...
drtrann Posted June 7, 2012 Author Share Posted June 7, 2012 you sir are my hero.... 16 hours wasted to be fixed in 5 seconds ;D *tip of the hat Link to comment Share on other sites More sharing options...
Kidney Posted June 7, 2012 Share Posted June 7, 2012 you sir are my hero.... 16 hours wasted to be fixed in 5 seconds ;D *tip of the hatits the little things that always mess us up right?? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now