Page 1 of 1

detecting a picture

Posted: 17 Nov 2017, 13:12
by Mightykiller
Hello so i need to start working on a project and i need help.
First i need to detect a picture on my screen
second when i press ALT my mouse cursor will aim on that picture

thats all i need can anyone help?

Re: detecting a picture

Posted: 18 Nov 2017, 18:51
by Mightykiller
HELLO ANYONE HERE XD ?

Re: detecting a picture  Topic is solved

Posted: 18 Nov 2017, 21:38
by Spawnova
First you will want to read the docs on ImageSearch

Here's an example

Code: Select all


#if foundImage ;the below hotkey only works if an image was found
    alt::
    mousemove,foundX,foundY
    foundImage := false ;disables hotkey, until next time you find an image
    return
#if

f1:: ;press f1 to scan for image.png
ImageSearch, FoundX, FoundY, 0, 0, A_ScreenWidth, A_ScreenHeight, *50 image.png ;search the entire screen, using image.png with a shade variance of 50 pixels
if (errorlevel = 0) {
    foundImage := true
} else {
    foundImage := false
}
return

Re: detecting a picture

Posted: 19 Nov 2017, 15:40
by Mightykiller
Tanks man i will try