PixelSearch

Ask gaming related questions (AHK v1.1 and older)
fug5333
Posts: 32
Joined: 03 May 2016, 08:55

PixelSearch

04 Jul 2019, 15:42

I'm trying to click repeatedly without a delay and (randomly) when an object appears, click it once, then resume to clicking without delay. Here's what I've got. When the script runs, the mouse cursor goes to the bottom left of the 'search box' and just sits there.

Code: Select all

Loop
	{
	PixelSearch, Px, Py, 65, 190, 800, 600, 0x9C6E6E, 10, Fast
	if ErrorLevel
		{
		Click
		}
	else
		{
		MouseMove %Px%, %Py%
		Click
		}
	}
Any ideas?
Thanks!
gregster
Posts: 9012
Joined: 30 Sep 2013, 06:48

Re: PixelSearch

04 Jul 2019, 17:43

Hard to say with this information, what the problem is.

But a common error (besides ignoring Coordmode) when using Pixelsearch is ignoring that it uses BGR format by default (and not RGB; you can change that by using RGB in the mode parameter).

I am also not sure, where you introduce the "random" component...
fug5333
Posts: 32
Joined: 03 May 2016, 08:55

Re: PixelSearch

04 Jul 2019, 19:58

I made the coordmode and RGB change and it worked. A tad quirky, but good enough for my purposes. :) Must have been the RGB thing as I tried the coordmode before with no success. Many thanks!! :D

Also, scanning the area and 'fast' are mostly all I can do to speed this up. Anything I can do to speed things up?
Thanks!

Return to “Gaming Help (v1)”

Who is online

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