JonasEu Posted April 20, 2023 Posted April 20, 2023 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
Nine Posted April 20, 2023 Posted April 20, 2023 Put it in the same place as your script. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy
JonasEu Posted April 20, 2023 Author Posted April 20, 2023 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"
Nine Posted April 21, 2023 Posted April 21, 2023 (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 April 21, 2023 by Nine “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy
JonasEu Posted April 21, 2023 Author Posted April 21, 2023 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: Now here is where it is on the screen: 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: 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
mistersquirrle Posted April 21, 2023 Posted April 21, 2023 (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 April 21, 2023 by mistersquirrle We ought not to misbehave, but we should look as though we could.
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