Can't get ImageSearch working

Get help with using AutoHotkey 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: 1069
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 tags when posting code!
Keyboard: Logitech G15 FE - Mice: Logitech G9 FE, G502 FE, G602 - OS: Windows 10 Pro 64 Bit - AHK version: 1.1.29.00
User avatar
noname
Posts: 509
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 :)
soundcloud.com/user-32706894
swagfag
Posts: 2991
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”

Who is online

Users browsing this forum: Gully, jashchro, jc0r and 61 guests