Help with PixelSearch Topic is solved

Ask gaming related questions (AHK v1.1 and older)
kauzds

Help with PixelSearch

17 Jan 2018, 16:51

I'm trying to use the function PixelSearch but I'm having a hard time. I want to check ALL the pixels in a particular area of my screen (in red) but for the life of me I can't get it to work because I'm too stupid to understand what "X1, Y1, X2, Y2" from "PixelSearch, OutputVarX, OutputVarY, X1, Y1, X2, Y2, ColorID [, Variation, Fast|RGB]" means.

My end goal is to get 2 colors from a game screen and send a keystroke when this 2 colors meet (color1 is a little | that moves from left to right and color2 is a stationary | pic).


Can anyone help?
User avatar
eventhorizon
Posts: 158
Joined: 27 Oct 2016, 14:22

Re: Help with PixelSearch

18 Jan 2018, 22:12

First thing to know is what your screen resolution is. In other words, what are it's x y dimensions. x is the number of pixels horizontally and y is the number of pixels vertically.

x1 y1 from the command is the upper left corner of the screen area you want to check
x2 y2 from the command is the lower right corner of the screen area you want to check
both of these are pixel based depending on your screen resolution. To get these right make sure you are not in True FullScreen mode. You can tell because True Fullscreen does not have a title bar on the window.
OutputVarX and OutputVarY are the screen pixel coords where the pixel color you're looking for was found -- if it was found.
ColorID is the rgb or bgr color that appears on the screen Every color is broken down into a Red, Green, and Blue component that is combined in a specific way to produce one unique color out of 16 million possible colors.
The RGB flag means you are using the color id in a RedGreenBlue configuration. if this flag is not specified the Color ID is assumed to be in BlueGreenRed configuration.

The upshot is that a pixel search requires a lot more from you to set up properly than many of the other AutoHotkey commands do. Reading screen colors and making comparisons is a skill well worth learning.. Start with the PixelGetColor command to get your feet wet first.
A computer lets you make more mistakes faster than any invention in human history – with the possible exceptions of handguns and tequila.
kauzds
Posts: 5
Joined: 17 Jan 2018, 16:52

Re: Help with PixelSearch  Topic is solved

20 Jan 2018, 02:06

eventhorizon wrote: The upshot is that a pixel search requires a lot more from you to set up properly than many of the other AutoHotkey commands do. Reading screen colors and making comparisons is a skill well worth learning.. Start with the PixelGetColor command to get your feet wet first.
I got it to work, thanks :)

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 48 guests