Jump to content

Image Search error

Recommended Posts

if $result[0]="0" then return 0
if $result^ ERROR

comes up after i have tried to run an Image Search script which failed

source code

#include <ImageSearch.au3>

global $y = 0, $x = 0


$result=_ImageSearch("start.bmp", 1, $x1, $y1, 0)
if $result = 1 then
   msgbox(0,"Result","Not Found!")

please help, why is this error comming up

Share this post

Link to post
Share on other sites

; Description:      Find the position of an image on the desktop
; Syntax:           _ImageSearchArea, _ImageSearch
; Parameter(s):
;                   $findImage - the image to locate on the desktop
;                   $tolerance - 0 for no tolerance (0-255). Needed when colors of
;                                image differ from desktop. e.g GIF
;                   $resultPosition - Set where the returned x,y location of the image is.
;                                     1 for centre of image, 0 for top left of image
;                   $x $y - Return the x and y location of the image
; Return Value(s):  On Success - Returns 1
;                   On Failure - Returns 0
; Note: Use _ImageSearch to search the entire desktop, _ImageSearchArea to specify
;       a desktop region to search

Experiment with tolerance, something like this works for me.

#include <ImageSearch.au3>
Local $x, $y
While 1
    If _ImageSearch(@ScriptDir&'\Capture.PNG',1, $x, $y, 10, 0)=1 Then ConsoleWrite(' - _ImageSearch - '&$x&' '&$y&' - '&@MSEC&@CRLF)



Paster - Main function is to paste text, but has more functions. (No longer mantained, switched to String Trigger)

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.

Firefox Profile Backup - Backup/restore previously saved profile.

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


Share this post

Link to post
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