Jump to content

Beta Version - Can't Compile or Run ImageSearch Script


Recommended Posts

So I was testing out the image search and when I tried to "Compile" and do a "Run" and I keep getting this error:

Line 1 (File "C:\Users\Mystogan\Desktop\ImageSearch.. \testing.aug"):

#include <ImageSearch.au3>

Error: Error opening the file.

--------------------------------------------------

The code executes perfectly when it's in edit mode.

#include <ImageSearch.au3>
#include <GDIPlus.au3>
Func Test()
    $fileA = @ScriptDir & "\recyclingBin.png"
    _GDIPlus_Startup()

    $hImageA = _GDIPlus_ImageLoadFromFile($fileA) ;this is the occupy icon
    $hBitmapA = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImageA)

    $x = 0
    $y = 0

    $result = _ImageSearch($hBitmapA, 1, $x, $y, 20, 0)
    If $result > 0 Then
        MouseMove($x, $y)
        Sleep(500)
        MouseClick($MOUSE_CLICK_PRIMARY, $x, $y, 2)
    EndIf
EndFunc

 

Edited by aa2zz6
For the Beta Version
Link to comment
Share on other sites

maybe, in Edit mode, you're running it as a x32 program,

and when you're running it in compiled form, as a x64 program (or vice versa)?

I learnt (after many long hours) that putting this line in the top gives control over this.

#AutoIt3Wrapper_UseX64=y ; Set to Y or N depending!

Maybe this helps?

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