Can't get ImageSearch working

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
TechnoNote
Posts: 1
Joined: 17 Jan 2019, 22:04

Can't get ImageSearch working

17 Jan 2019, 22:08

Heres what I currently got:

Code: Select all

ImageSearch, X, Y, 0, 0, a_ScreenWidth, A_ScreenHeight, default_large.png
If Errorlevel = 0
	msgBox Works
else if ErrorLevel = 1
	msgBox Doesn't work
The image can be found here:
http://i1.wp.com/autohotkey.com/board/p ... _large.png

No matter what I do, I can't find the image, I really don't see what I'm doing wrong. I hope someone can help me.
User avatar
Scr1pter
Posts: 1272
Joined: 06 Aug 2017, 08:21
Location: Germany

Re: Can't get ImageSearch working

18 Jan 2019, 09:01

The script and the Image must be located in the same directory.
Otherwise you will have to add the path to the Image.

Additionally you can add some tolerance.
For example

Code: Select all

ImageSearch, X, Y, 0, 0, A_ScreenWidth, A_ScreenHeight, *100 C:\folder\default_large.png
Check the doc for ImageSearch because I don't have all the syntaxes in my mind.
(I'm currently using the phone.)

Cheers!
Please use [code][/code] when posting code!
Keyboard: Logitech G PRO - Mouse: Logitech G502 LS - OS: Windows 10 Pro 64 Bit - AHK version: 1.1.33.09
User avatar
noname
Posts: 515
Joined: 19 Nov 2013, 09:15

Re: Can't get ImageSearch working

18 Jan 2019, 09:05

Your code seems to work with the image you provided .

Code: Select all

Gui, add,picture,,default_large.png
Gui, show
sleep 3000

ImageSearch, X, Y, 0, 0, a_ScreenWidth, A_ScreenHeight, default_large.png
If Errorlevel = 0
	msgBox Works
else if ErrorLevel = 1
	msgBox Doesn't work
update : i see scripter already gave a response and a good one too :)
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: Can't get ImageSearch working

18 Jan 2019, 09:20

also check ur coordmode settings

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Fredrik F, Joey5, maxkill, Rohwedder and 396 guests