PixelSearch runs even if the color is not there

Get help with using AutoHotkey and its commands and hotkeys
Flopz
Posts: 3
Joined: 20 Jun 2018, 10:14

PixelSearch runs even if the color is not there

20 Jun 2018, 10:25

Whenever I call this to run, it always finds the color in that part of the screen making it send the function below although it shouldn't. Not sure what I'm doing wrong here. Main goal is to have a loop going, that checks a certain part of my screen for a color, if it finds it there, it send some text into a non-active window, then runs it again whenever the color appears in that region again.

Thank you for your help.

Code: [Select all] [Download] GeSHi © Codebox Plus

Red_1:
CoordMode, Pixel, Screen
PixelSearch, Px, Py, 23, 265, 102, 280, ffff00, 1, Fast
if ErrorLevel = 0 ; ErrorLevel is set to 0 if the colour is found
{
SendMode, Event
SetKeyDelay, 30, 30
ControlSend, , "TEST", ahk_class grcWindow
MsgBox, TEST
}
Return
Hellbent
Posts: 142
Joined: 23 Sep 2017, 13:34

Re: PixelSearch runs even if the color is not there

20 Jun 2018, 10:38

Try replacing

---> ffff00
with
---> "ffff00"
Or
---> 0xffff00
Flopz
Posts: 3
Joined: 20 Jun 2018, 10:14

Re: PixelSearch runs even if the color is not there

20 Jun 2018, 10:48

Didn't change anything I'm afraid, but thanks.
Hellbent
Posts: 142
Joined: 23 Sep 2017, 13:34

Re: PixelSearch runs even if the color is not there

20 Jun 2018, 11:03

Flopz wrote:Didn't change anything I'm afraid, but thanks.


Really?

This works

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus



press numpad1 to find pixel
Flopz
Posts: 3
Joined: 20 Jun 2018, 10:14

Re: PixelSearch runs even if the color is not there

20 Jun 2018, 15:27

Does, but problem is, I really can't understand why mine does not find the pixel.
swagfag
Posts: 842
Joined: 11 Jan 2017, 17:59

Re: PixelSearch runs even if the color is not there

20 Jun 2018, 15:33

just so were on the same page here, cuz i notice the name of your label(Red_1:), you are aware of the fact that youre pixelsearching for a cyan...ish, arent you? PixelSearch is BGR by default, which would put 0xFFFF00 with a variation of 1 shade, in the cyanish range.

Return to “Ask For Help”

Who is online

Users browsing this forum: No registered users and 53 guests