raktar Posted March 25, 2015 Share Posted March 25, 2015 (edited) hey guys, I recently started using the AutoIT image search, and its been working fine... then it just quit working for some reason. No error code it just doesn'Tfind the image. im using the exact same code i was using and it still isnt working.ANY help is very appreciated.Also i have the image and the script in the same folder. Here is one of the 4 scripts ive tried. #include <ImageSearch.au3> sleep(2000) $X = 0 $Y = 0 $X1 = 0 $Y1 = 0 Func start() $Search = _ImageSearch('Play.bmp', 0, $X, $Y, 0) If $Search = 1 Then MouseMove($X, $Y,10) EndIf EndFunc Edited March 25, 2015 by raktar Link to comment Share on other sites More sharing options...
JohnOne Posted March 25, 2015 Share Posted March 25, 2015 A function needs to be called, else it does nothing. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
raktar Posted March 25, 2015 Author Share Posted March 25, 2015 A function needs to be called, else it does nothing. can you please post a fixed version for me that would be greatly appreciated man, thanks Link to comment Share on other sites More sharing options...
JohnOne Posted March 25, 2015 Share Posted March 25, 2015 I'll post solution to the problem I mentioned, but I'll leave it to you, to read about imagesearch parameters to figure out you next problem with it. #include <ImageSearch.au3> sleep(2000) $X = 0 $Y = 0 $X1 = 0 $Y1 = 0 start() Func start() $Search = _ImageSearch('Play.bmp', 0, $X, $Y, 0) If $Search = 1 Then MouseMove($X, $Y,10) EndIf EndFunc AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
raktar Posted March 25, 2015 Author Share Posted March 25, 2015 I'll post solution to the problem I mentioned, but I'll leave it to you, to read about imagesearch parameters to figure out you next problem with it. #include <ImageSearch.au3> sleep(2000) $X = 0 $Y = 0 $X1 = 0 $Y1 = 0 start() Func start() $Search = _ImageSearch('Play.bmp', 0, $X, $Y, 0) If $Search = 1 Then MouseMove($X, $Y,10) EndIf EndFunc i've been trying for hours i have no idea man Link to comment Share on other sites More sharing options...
JohnOne Posted March 25, 2015 Share Posted March 25, 2015 That code above was never working, not yesterday, last week or last month, It's flawed quite obviously. Why you say it was working before? AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
raktar Posted March 25, 2015 Author Share Posted March 25, 2015 That code above was never working, not yesterday, last week or last month, It's flawed quite obviously. Why you say it was working before? Im not trying to lie, i had it working before i had rewrote the script and now it isn't working i must have written it wrong. I just read on image search and still cannot find my solution. Link to comment Share on other sites More sharing options...
JohnOne Posted March 25, 2015 Share Posted March 25, 2015 Well, in what area are you searching? AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
raktar Posted March 25, 2015 Author Share Posted March 25, 2015 Well, in what area are you searching? I'm currently getting this error code "if $result[0]="0" then return 0 if $result^ ERROR" I thought i needed to add an Elseif but apparently not.... Link to comment Share on other sites More sharing options...
JohnOne Posted March 25, 2015 Share Posted March 25, 2015 I don't see that code anywhere. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Blue_Drache Posted March 25, 2015 Share Posted March 25, 2015 I'll go one farther than John and ask what program you are using imagesearch on? Which application might make a difference and there might be a better solution. Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache Link to comment Share on other sites More sharing options...
raktar Posted March 26, 2015 Author Share Posted March 26, 2015 I'll go one farther than John and ask what program you are using imagesearch on? Which application might make a difference and there might be a better solution. I had used it on desktop icons things in google and in hearthstone, but now i cant remember the code i was using, i really like image search and hope to get it working. I added start() to it and now im getting this error code (44) : ==> Subscript used on non-accessible variable.: if $result[0]="0" then return 0 if $result^ ERROR Also i tried this one and i get no error code for this either #include <ImageSearch.au3> sleep(2000) global $y = 0, $x = 0 Func checkForImage() Local $search = _ImageSearch("Killed3.bmp", 1, $x, $y,1 ) If $search = 1 Then MouseMove($x, $y, 10) EndIf EndFunc (44) : ==> Subscript used on non-accessible variable.: if $result[0]="0" then return 0 if $result^ ERROR Link to comment Share on other sites More sharing options...
JohnOne Posted March 26, 2015 Share Posted March 26, 2015 If you want real help, you are going to have to post the exact code you are using, else you're just wasting peoples time. Absolutely none of the code you have posted will generate the error you say you have. It doesn't even contain a $result variable. Until that time, best of luck. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
raktar Posted March 26, 2015 Author Share Posted March 26, 2015 If you want real help, you are going to have to post the exact code you are using, else you're just wasting peoples time. Absolutely none of the code you have posted will generate the error you say you have. It doesn't even contain a $result variable. Until that time, best of luck. sleep(2000) $X = 0 $Y = 0 $X1 = 0 $Y1 = 0 start() Func start() $Search = _ImageSearch('Play.bmp', 0, $X, $Y, 0) If $Search = 1 Then MouseMove($X, $Y,10) EndIf EndFunc if you enter this code into autoIT you WILL get this error (44) : ==> Subscript used on non-accessible variable.: if $result[0]="0" then return 0 if $result^ ERROR im just asking for someone to write me a image search script for autoIT thats all Link to comment Share on other sites More sharing options...
BrewManNH Posted March 26, 2015 Share Posted March 26, 2015 First, which version of ImageSearch are you using? There are several floating around. Second, that error line is coming from the ImageSearch.au3 file, it is probably a bug in whichever version it is you're using. The >version that I looked at has absolutely no error checking in it, so I'm not surprised if it would cause errors to happen. Poor coding example if you ask me. Third, are you using the correct DLL version for your operating system? There's a 32 bit and a 64 bit version of the DLL, make sure you're using the right one. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
raktar Posted March 26, 2015 Author Share Posted March 26, 2015 First, which version of ImageSearch are you using? There are several floating around. Second, that error line is coming from the ImageSearch.au3 file, it is probably a bug in whichever version it is you're using. The >version that I looked at has absolutely no error checking in it, so I'm not surprised if it would cause errors to happen. Poor coding example if you ask me. Third, are you using the correct DLL version for your operating system? There's a 32 bit and a 64 bit version of the DLL, make sure you're using the right one. Well thank you very much for your response, do you know of a link i could get a 64 bit version? i was getting them off forums and trying them cant get any too work. the first one i tried worked but it quit working for some reason, i had found 3 others ones but no luck :/ if you could find a version and a working code for me it would be greatly appreciated. phuocvovan 1 Link to comment Share on other sites More sharing options...
Blue_Drache Posted March 27, 2015 Share Posted March 27, 2015 I had used it on desktop icons things in google and in hearthstone, but now i cant remember the code i was using, i really like image search and hope to get it working. I added start() to it and now im getting this error code (44) : ==> Subscript used on non-accessible variable.: if $result[0]="0" then return 0 if $result^ ERROR Also i tried this one and i get no error code for this either #include <ImageSearch.au3> sleep(2000) global $y = 0, $x = 0 Func checkForImage() Local $search = _ImageSearch("Killed3.bmp", 1, $x, $y,1 ) If $search = 1 Then MouseMove($x, $y, 10) EndIf EndFunc (44) : ==> Subscript used on non-accessible variable.: if $result[0]="0" then return 0 if $result^ ERROR Hearthstone is a game. Please read the forum rules. '?do=embed' frameborder='0' data-embedContent>> Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 27, 2015 Moderators Share Posted March 27, 2015 raktar,Blue_Drache is quite right - please read the >Forum rules (the link is also at bottom right of each page) - particularly the bit about not discussing game automation - before you post again. Thread locked. But welcome to the AutoIt forum - and see you soon with a legitimate question I hope. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Recommended Posts