Jump to content

AutoIT image search problems


Recommended Posts

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 by raktar
Link to comment
Share on other sites

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

 

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

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

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

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

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

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 Gude
How 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

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. :)

Link to comment
Share on other sites

 

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

  • Moderators

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. :naughty:

But welcome to the AutoIt forum - and see you soon with a legitimate question I hope. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...