PixelSearch PLEASE HELP

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
japankid3000
Posts: 43
Joined: 14 Nov 2015, 09:58

PixelSearch PLEASE HELP

20 Jan 2016, 12:34

Hello my script will not send clicks to the pixel ColorID , i do not quite understand how i get the X and Y coordinates of the upper left corner of the rectangle to search.

I use WinodowSpy and it tells me the coordinates but how do i drag a rectangle to make it more accurate.

Code: Select all

f1::
CoordMode, Pixel, Screen
CoordMode, Mouse, Screen
 
Loop

{
	PixelSearch, FoundX, FoundY, 0, 0, 0, 0, 8C929E, 3, Fast
 
	If (ErrorLevel = 0)
	{
		Click, FoundX, FoundY
		Sleep, 80
	}
 
	Sleep, 80
	PixelSearch, FoundX, FoundY, 0, 0, 0, 0, 627AAD, 3, Fast 

	If (ErrorLevel = 0)
	{
	      
		Click, FoundX, FoundY
		Sleep, 8000
	}

}
 
return
z::pause
User avatar
Blackholyman
Posts: 1293
Joined: 29 Sep 2013, 22:57
Location: Denmark
Contact:

Re: PixelSearch PLEASE HELP

20 Jan 2016, 12:55

0,0 is the upper left corner of the screen or window

The next two 0,0 is where you input the size of your screen if you wish to search the full screen

Example of searching from coords x100,y100 to x400,y400 can look like this

Code: Select all

PixelSearch, FoundX, FoundY, 100, 100, 400, 400, 8C929E, 3, Fast
 
	If (ErrorLevel = 0)
	{
		Click, %FoundX%, %FoundY%
		Sleep, 80
	}
Also check out:
Courses on AutoHotkey

My Autohotkey Blog
:dance:
japankid3000
Posts: 43
Joined: 14 Nov 2015, 09:58

Re: PixelSearch PLEASE HELP

21 Jan 2016, 13:34

I remember reading in a Python book to not reinvent the wheel, well anyways i watched a Youtube video and noticed Pulover's macro creator has a function to drag a rectangle over my button, and a PixelSearch feature which are both very convenient.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot] and 132 guests