spartum Posted February 4, 2014 Share Posted February 4, 2014 (edited) I've done minimal coding in the past (html, css, java, php). Java / php mostly being from tutorials then tweaking for my own needs. I want to learn to use this program so I can write some of my own scripts, and the ImageSearch function is required for almost all of my plans. I tried following this tutorial, and seem to have failed :/ Edited February 4, 2014 by spartum Link to comment Share on other sites More sharing options...
spartum Posted February 4, 2014 Author Share Posted February 4, 2014 Okay, after bouncing around the forums, reading, googling, etc. I figured out I had the imagesearch.au3 file and the .dll files in the wrong locations, + I needed to run the script as x64. So if anyone else shows up here with questions like mine, the Imagesearch.au3 file goes to "C:\Program Files (x86)\AutoIt3\Include\" and the .dll goes to "C:\Windows\System32\" And for the record, my silly message boxes worked too! Link to comment Share on other sites More sharing options...
AutID Posted February 4, 2014 Share Posted February 4, 2014 So just by moving the udf to the include path and the dll to system32 solved the problem??? I have a compiled project which crashes on windows 8. I have the dll in the same directory as the exe. I will try to move it in the system32 and see what it gives. If that is the case, you made my day. Welcome to the forum. https://iblockify.wordpress.com/ Link to comment Share on other sites More sharing options...
spartum Posted February 4, 2014 Author Share Posted February 4, 2014 So just by moving the udf to the include path and the dll to system32 solved the problem??? I have a compiled project which crashes on windows 8. I have the dll in the same directory as the exe. I will try to move it in the system32 and see what it gives. If that is the case, you made my day. Welcome to the forum. That and then instead of just running the script, I right click > Run as x64 It was also suggested (in the youtube video comments I think) to try as x86 as well. x86 didn't do it for me, but x64 did. Let me know how it went for you Link to comment Share on other sites More sharing options...
AutID Posted February 4, 2014 Share Posted February 4, 2014 The x86 or x64 depends on the OS you have. I didn't tried it yet. What I am understanding from this is that the windows 8 are missing some standard dlls that windows 7 have. I have winhttp and bass dlls included on my project so that's why my script was crashing I suppose. Thank you anyway. https://iblockify.wordpress.com/ Link to comment Share on other sites More sharing options...
WelshWillis Posted February 13, 2014 Share Posted February 13, 2014 FINALLY! an uptodate post about 'ImageSearch'! You have no idea how fustrated I've been trying to work this thing. I followed the above instructions (and used the 'silly' script as a tester) and I'm forever greatful for you Thank you soooooooo much I'm using Win7 and the outcome is the same. A couple of notes - _ImageSearch('FINDME!.bmp', 0, $X, $Y, 0) will return the $X, $Y co-ords of the top left corner of the image _ImageSearch('FINDME!.bmp', 1, $X, $Y, 0) will return the $X, $Y co-ords of the center of the image Also as I found out when editing the picture in Paint, (printscreen, paste, select image part and re-paste;) ensure you shrink the 'White' area to match or overlap the Image you pasted. Any white border, unless it's part of the image you want to find, will return a 'False' value. Link to comment Share on other sites More sharing options...
Ein Posted March 12, 2014 Share Posted March 12, 2014 I get this error "C:\Program Files (x86)\AutoIt3\Include\ImageSearch.au3" (40) : ==> Subscript used on non-accessible variable.: if $result[0]="0" then return 0 if $result^ ERROR But if i change to If $result="0" then return 0 I always get 00 for coords, any ideas why? #Include <ImageSearch.au3> HotKeySet ("{F1}","_Start") HotKeySet ("{F4}","_Exit") $x=0 $y=0 Func _Start() local $search=_ImageSearch(".\bin\search\test.png",1,$x,$y,10) ConsoleWrite("-Found "&$x&$y&@CRLF) If $search=1 Then MouseMove($x,$y,10) ConsoleWrite("-MouseMovedTo "& $x & $y & @CRLF) EndIf EndFunc While 1 sleep(100) WEnd Func _Exit() MsgBox(0,"Quit","Hit OK to Exit") Exit EndFunc Link to comment Share on other sites More sharing options...
Danp2 Posted March 12, 2014 Share Posted March 12, 2014 You may want to start your own thread instead of jumping on this existing one. Also, I'm guessing that you are running an older version of AutoIt. Try upgrading to the latest to see if that addresses your issue. Latest Webdriver UDF Release Webdriver Wiki FAQs 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