Jump to content

Image Search Library


Recommended Posts

  • Replies 247
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

Hi Folks, I'm a great fan of AutoIT. While trying to automate data entry into a java applet based ERP, I found that checking for entry error or success is quite a pain using pixelsearch. Instead, che

Lucky, I still have a backup of this See attached. However, I don't know how to get it working I'm constantly getting: if $result[0]="0" then return 0 if $result^ ERRORWhenever I run... (Line 4

Fixed my issue with Win7 64bit. Thx alot. it works now!

Posted Images

Hey all, I'm trying to use the ImageSearch func, and include, but neither seem to work, all I recieve under #include <ImageSearch.au3> is ERROR: can't open include file <as previous> and under the function <undefined func> obviously due to no .au3.

I've tryed a few of the suggest files in this thread and I also am running autoit on x86 and have tryed moving the files around to no end.

am i missing something?

thanks for your time

Link to post
Share on other sites

Put the UDF file in your script's folder, then use #include "ImageSearch.au3" instead of using <>.

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 post
Share on other sites

Put the UDF file in your script's folder, then use #include "ImageSearch.au3" instead of using <>.

Thanks brew, it's my first day with autoit, i was getting confused 'cause the folders name was 'include' and wasn't accessible through startmenu> all programs , but found it attempting to do something that wouldn't have helped me.

cheers!

Link to post
Share on other sites
  • 3 weeks later...

hi

i have made a script but i still need help with imagesearch i have the dll in the windows System32 and SysWOW64

i have runed it as admin. Still not working :(((((

pls help me 

skype : sadrisadri215
 

sry 4 bad english

thx sadness

Link to post
Share on other sites
  • 2 weeks later...

Hi Folks,

I'm a great fan of AutoIT. While trying to automate data entry into a java applet based ERP, I found that checking for entry error or success is quite a pain using pixelsearch. Instead, check for a data entry "success" or "failed" image is far simpler.

This a feature found in AHK, I've cut out the necessary code and compiled it into a DLL, and written a au3 library around it. I've tested it in various XP and W2k3 machines, and it seems to work fine. It's a quick and dirty hack I did to get a job done, so your mileage may vary :)

585581.i.png ImageSearch.zip (84K) Number of downloads: 585581.png

 

The ImageSearch.dll file does not exist anymore >_<. Is there anybody who have it or a similar library for AutoIt? I really need this feature to automate the new Win 8 interface.

So far I have used Sikuli but it is not a smart solution, difficult to maintain. :ermm:

/Lars

/Lars

Denmark

www.lpmathiasen.com

Automation and simplification is my game!

Link to post
Share on other sites
  • 1 month later...

@Edano, yes, in fact a newbie is having trouble finding something to click on! I am using some code snippets from previous posts here. For some reason, it won't find the image I'm trying to search for. I have attached the image I am searching for (it is a screenshot of the 'Edit' button in Notepad which is a .bmp image in my script directory, but the image uploader changed it to .png). Yes, I have opened Notepad and the title bar is within a 750x750 square from the top left corner. butRERF.png

#AutoIt3Wrapper_UseX64=n

#include <Array.au3>
#include <ImageSearch.au3>

;
; Demo on the functions of ImageSearch
;

MsgBox(0, "MSG", "You need to have an image visible on your screen")

$x1 = 0
$y1 = 0
Global $result


MsgBox(0, "MSG", "Search for image the top left corner in a 750x750 box")

; find image if it is in the top left corner of screen
$result = _ImageSearchArea("notepadfile.bmp", 1,0,0,750,750, $x1, $y1, 0)
If $result = 1 Then
    MouseMove($x1, $y1, 3)
    MsgBox(0, "Found", "Found the image in top left corner")
Else
    MsgBox(0, "Néant", "Je n'ai pas trouvé l'image")
EndIf

I was also experiencing the same array issue that everyone else was having, and when the solutions I saw posted didn't work, I changed

if ($result[] = "0") then return 0

to

if ($result = "0") then return 0
Edited by DeLorean
Link to post
Share on other sites
  • 3 months later...

is there a way to implement/load/use the dll in C#?

I know thats not the right forum for this question, but i cant find any c#-solution thats work so fast.

I tried with DLLImport and i got no errors. But if i want to load an image the programm exits without any errors. :/
If i try the 64bit-version (i found here) then it doesnt exits but i get the error "BadImageFormat". (have tried some formats but nothing changes xD)

anyone a idea?

Link to post
Share on other sites
  • 2 weeks later...

So, I had a copy of this from a couple months back and have been playing with it. I have discovered something very interesting. If the .dll is not located in the autoitInclude folder, the function doesn't work even after the script is compiled. I have tried it with the .dll in the windowssystem32 but no go. If I have the folder C:\Program Files\AutoIt3\Include\ present and have the .dll located there, it works! Is this an issue with the ImageSearch.au3? Since I plan on using this on computers that do not have AutoIt installed I am hoping to see if I can find the solution to the problem. I know that the compiller has a tab 'Res Add Files' and then a box for 'Extra Files'...I am not sure if I try putting the .dll there if that will help or not as I have not messed with that functionality to date and not quite sure what it is used for specifically. I will include some of my code just for refference in case I am not calling the function properly etc. I won't include all the code, just up until it trys to use _ImageSearch. Thanks in advance for any help with this!....UPDATE!! So I opened up the ImageSearch.au3 and I see the problem

$result = DllCall("C:\Program Files\AutoIt3\Include\ImageSearchDLL.dll","str","ImageSearch","int",$x1,"int",$y1,"int",$right,"int",$bottom,"str",$findImage)

This is telling the program to look specifically at that location for the .dll!!!

What is the best way to change that to specify the system folder for various OS? I know something with wildcard % etc?

Hopefully this helps others too!

 
Edited by itctravel
Link to post
Share on other sites

I'm using image search and everything was running perfectly on my computer using win7 32bit

and I finished my whole script and tested it as .exe and no errors until I compiled it and tried to test it on other computers then

an error apeared "Error: subscript used with non-Array variable."

both computes running 32bit version of windows 7 and xp

I searched the forum and read all the comments in the post but i didn't find any solution for 32bit problem all the solutions related to 

using 64bit os

please help I was working on my script for weeks and after i finished I face this problem :(

#include <ImageSearch.au3>

Global $x = 0
Global $y = 0
Global $sFldr1 = @DocumentsCommonDir & "\Files\"
Do
    Local $startimage = _ImageSearch($sFldr1 & "\startimage.png", 1, $x, $y, 10) 
    If $startimage = 0 Then
        Sleep(100)
    EndIf
Until $startimage = 1
Sleep(500)

the image and files are created and located where they supposed to be(@DocumentsCommonDirfilesstartimage.png)

I tried all the solutions in the post but nothing work!!!

Link to post
Share on other sites
  • Moderators

Based upon your previous entries, this wouldn't be startimage.png that comes with Legacy of Heroes would it.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to post
Share on other sites

I'm sure the subscript error would appear on your computer as well.

If you could run your script on the other computer from SciTe you would get the line number where the error occurs.

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2021-11-10 - Version 1.6.0.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (NEW 2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (NEW 2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to post
Share on other sites

This is the problem on my computer I have no error at all and every thing work fine.

just give 5 min and I will install SciTe on the other computers and try and give you the result

 

ok here the error on win7 32bit

C:\Program Files\AutoIt3\Include\ImageSearch.au3 (40) : ==> Subscript used with non-Array variable.:
if $result[0]="0" then return 0
if $result^ ERROR
->00:31:37 AutoIt3.exe ended.rc:1
>Exit code: 1    Time: 12.776

I researshed the post before the edit but I found no answer for 32bit all the sulotions for 64bit!!!

 

**************************************************************************

I found the problem, it's in the UDF the function:

DllCall("ImageSearchDLL.dll" it's not specified from where to call the dll

i modified it and added intall dll file to the script with the same path of other files

and it's working now  :thumbsup:

but is there another method to call the dll file without installing it with other files

I'll try to embed it in the script and call it from memory

is there a better way? :huh2:

Edited by milad0011988
Link to post
Share on other sites
  • Jos locked this topic
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...