Jump to content

Recommended Posts

Posted

Problem: Im using the ImageSearchArea function, but it always returns error. I researched the function itself, and found out it performs a DllCall on a dll file called "ImageSearchDLL.dll" which - as it turned out after a simple search - doesn't exist in the files of the Autoit software.

I manually downloaded the dll file from the internet, but now i don't know where to place it to make it work.

Searching for any kind of information about dealing with dll files in Autoit just resulted with the filling of my brain with a lot of unnccessery information about creating dll's which didn't help at all.

Does anyone know?

Thanks in advance

Posted
5 minutes ago, Nine said:

Put it in the same place as your script.

Tried it. Didn't work.

It also didn't work when i placed it at the same location of the "include" file in the Autoit files (where the script of the ImageSearch function actually is, if that's what you meant), and so also happend when i placed it in the location of all of the dll files in windows, which is in the path "C:\Windows\System32"

  

Posted (edited)

You must match x32 or x64 to your dll, otherwise it will not work.  Do not put it in the AutoIt Include folder, nothing is intended to get dll from there.  Do not put the dll in the Windows folder/subfolder as redirection may be involved.

Post code that does not work and a screen shot of what you are trying to automate.  Also make sure you read forum rules to ensure you are using this dll appropriately.

 

Edited by Nine
Posted
7 hours ago, Nine said:

You must match x32 or x64 to your dll, otherwise it will not work.  Do not put it in the AutoIt Include folder, nothing is intended to get dll from there.  Do not put the dll in the Windows folder/subfolder as redirection may be involved.

Post code that does not work and a screen shot of what you are trying to automate.  Also make sure you read forum rules to ensure you are using this dll appropriately.

 

I'm trying for now to make a simple detection of image. It doesn't work even in the very basic way, so that's gonna be the whole thing im gonna show here.

This is the image Im trying to detect:

image.png.8a5627caa3cc70c05618ec5786242245.png

Now here is where it is on the screen:

image.thumb.png.1c328b3dc8e1ce86270d58e144586596.png

Here you can see my very simple code:

#include <ImageSearch.au3>

$x = 0
$y = 0
Local $pic = "C:\Users\User\Desktop\bot\aaa.png"

$res = _ImageSearch($pic, 1, $x, $y, 0, 0)

And here you can see the result im getting in the console:

image.png.df87aecff5e7257f29be7f14d1fed273.png

As you can see from the result on the console, im getting an error because the $result variable from the ImageSearch script (which is supposed to contain the position of the image found) is not even an array, due to the fuct that there was no image found

Posted (edited)

I had no issues using image search with this, also looking for the YouTube Watch Later button:
 

#include "ImageSearch.au3"

Global $x = 0
Global $y = 0
Global $iTolerance = 10
Global $iTransparency = 0
Global $pic = @ScriptDir & "\aaa.png"
ConsoleWrite('Searching for ' & $pic & @CRLF)

; _ImageSearch($findImage, $resultPosition, ByRef $x, ByRef $y, $tolerance, $transparency = 0)
Global $res = _ImageSearch($pic, 1, $x, $y, $iTolerance, $iTransparency)

If @error Then
    ConsoleWrite('ImageSearch error: ' & @error & ', extended: ' & @extended & @CRLF)
    Exit
EndIf

If $res Then
    ConsoleWrite('Found image at: ' & $x & ', ' & $y & @CRLF)
Else
    ConsoleWrite('Image not found' & @CRLF)
EndIf

 

Searching for C:\Users\Raven\Documents\AutoIt\Forums\210111-where-does-dll-files-should-be-to-make-it-work-in-dllcall\aaa.png
+>@OSArch=X64   @AutoItX64=1    therefore using x64 ImageSearch DLL
Found image at: 36, 544

It's possible that the DLLs you have are corrupted or not the correct version. I have DLLs timstamped as 2015 and 2017 for their modified date. The 2017 DLLs did not work, the 2015 ones did. They were the same size, so I'm not sure what other differences there may be.

However, my "ImageSearch.au3" file does not have the line from your error, there's nothing that has "if $result[0]", so you may have a different version or have made edits.

 

Edit: Actually regarding the DLLs there's another required set of DLLs. I have msvcr110.dll and msvcr110d.dll, without them ImageSearch.au3 fails to open/use the ImageSearchx64.DLL.

Edited by mistersquirrle

We ought not to misbehave, but we should look as though we could.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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