detecting a picture Topic is solved

Ask gaming related questions
Mightykiller
Posts: 43
Joined: 09 Oct 2017, 13:34

detecting a picture

17 Nov 2017, 13:12

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?
Mightykiller
Posts: 43
Joined: 09 Oct 2017, 13:34

Re: detecting a picture

18 Nov 2017, 18:51

HELLO ANYONE HERE XD ?
User avatar
Spawnova
Posts: 339
Joined: 08 Jul 2015, 00:12
Contact:

Re: detecting a picture  Topic is solved

18 Nov 2017, 21:38

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
Last edited by Spawnova on 19 Nov 2017, 18:35, edited 1 time in total.
Mightykiller
Posts: 43
Joined: 09 Oct 2017, 13:34

Re: detecting a picture

19 Nov 2017, 15:40

Tanks man i will try

Return to “Gaming”

Who is online

Users browsing this forum: No registered users and 14 guests