Jump to content

Image Search help


Stuvven
 Share

Recommended Posts

On 1/1/2019 at 5:54 AM, careca said:

Hi, can you try it like this?

;#requireadmin ;Disables the console output, if the code still doesn't work, comment it.
#include <MsgBoxConstants.au3>
Local $HBMP = 0
Local $x1 = 0, $y1 = 0
Local $right = @DesktopWidth
Local $bottom = @DesktopHeight
Local $findImage = @ScriptDir & '\Capture.PNG'
While 1
    $result = DllCall("ImageSearchDLL.dll", "str", "ImageSearch", "int", $x1, "int", $y1, "int", $right, "int", $bottom, "str", $findImage, "ptr", $HBMP)
    If @error Then
        ConsoleWrite('There was an error: ' & @error & @CRLF)
    Else
        If IsArray($result) = 1 Then
            If $result[0] <> 0 Then
                $array = StringSplit($result[0], "|")
                ConsoleWrite('XPos - ' & $array[2] & ' - YPos - ' & $array[3] & ' - XSize - ' & $array[4] & ' - YSize - ' & $array[5] & @CRLF)
            Else
                ConsoleWrite('Not found' & @CRLF)
            EndIf
        EndIf
    EndIf
    Sleep(100)
WEnd

ps: "DLLCall: @error" this was just a hint for you to get the error number, not an actual line of code, my bad, i wasn't clear on that.

Ran it and it says: "There was an error: 1"

Link to comment
Share on other sites

5 hours ago, Stuvven said:

Ran it and it says: "There was an error: 1"

For careca file is x64 DLL!

Unable to open x64 DLL in x86 Program, you need an x86 DLL version. Or run the program autoit with x64 mode.

In short. You need to download the Dll again accordingly!

 

Regards,
 

Link to comment
Share on other sites

Well, in the second post i read this: @OSArch=X64

@Stuvven: Do you have a 32bit OS?

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
Share on other sites

You're running the 32bit autoit exe.

As can be seen in the second post and one further down, in the console output you posted.

" @AutoItX64=0    therefore using x32 ImageSearch DLL "

here

"I run my script and this is all it says in the log: >"C:\Program Files (x86)\AutoIt3\SciTE\..\autoit3.exe" Instead of autoit3_x64.exe

and

" OSArch : X64 // AutoIT ver: 3.3.14.5 x86 "

So i think that if you run it with the 64bit autoit, it'll work.

 

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
Share on other sites

5 hours ago, careca said:

You're running the 32bit autoit exe.

As can be seen in the second post and one further down, in the console output you posted.

" @AutoItX64=0    therefore using x32 ImageSearch DLL "

here

"I run my script and this is all it says in the log: >"C:\Program Files (x86)\AutoIt3\SciTE\..\autoit3.exe" Instead of autoit3_x64.exe

and

" OSArch : X64 // AutoIT ver: 3.3.14.5 x86 "

So i think that if you run it with the 64bit autoit, it'll work.

 

Ran your script, have the image provided opened on my 2nd monitor and this is what came up when the script was ran. Had to press ctrl + break to get it to stop spamming.

>"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "C:\Users\steph\Desktop\Scripts\AutoIt\Image Search\test\Example.au3" /UserParams    
+>19:28:27 Starting AutoIt3Wrapper v.19.102.1901.0 SciTE v.4.1.2.0   Keyboard:00000409  OS:WIN_10/  CPU:X64 OS:X64  Environment(Language:0409)  CodePage:0  utf8.auto.check:4
+>         SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE   UserDir => C:\Users\steph\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper   SCITE_USERHOME => C:\Users\steph\AppData\Local\AutoIt v3\SciTE 
>Running AU3Check (3.3.14.5)  from:C:\Program Files (x86)\AutoIt3  input:C:\Users\steph\Desktop\Scripts\AutoIt\Image Search\test\Example.au3
+>19:28:27 AU3Check ended.rc:0
>Running:(3.3.14.5):C:\Program Files (x86)\AutoIt3\autoit3_x64.exe "C:\Users\steph\Desktop\Scripts\AutoIt\Image Search\test\Example.au3"    
+>Setting Hotkeys...--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop
Not found
Not found
Not found
Not found
Not found

>Process failed to respond; forcing abrupt termination...
>Exit code: 1    Time: 1.909
 

I've also tried running the script on the same monitor that has the image opened up on, and then minimizing scite, but my mouse still didn't move to the picture.

Link to comment
Share on other sites

As im not sure it works on secondary monitors, and to troubleshoot, can you try keeping it all in the primary monitor and test that way?

No need to minimize anything, just make sure the whole image is visible.

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
Share on other sites

Im out of ideas, it should work.

 

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
Share on other sites

Its function is to search for images exactly according to size and pixel. With the appearance anywhere on the display screen!

Watch the video for example, if you still can't make your script work then I give up.

 

Regards,
 

Link to comment
Share on other sites

1 hour ago, VIP said:

Its function is to search for images exactly according to size and pixel. With the appearance anywhere on the display screen!

Watch the video for example, if you still can't make your script work then I give up.

 

This actually worked! Is it possible to get it to where it won't require me to capture a spot on my screen through the script? So that I can just have the picture inside the folder and it'll search for the same image on my screen?

Link to comment
Share on other sites

7 hours ago, Stuvven said:

Is it possible to get it to where it won't require me to capture a spot on my screen through the script? 

You need to think more, and try it yourself.
You only need to run it once to help you create the image you are looking for. You can then delete it.

Regards,
 

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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