Page 1 of 1

how to find two pixelcolors ?

Posted: 12 Jul 2018, 12:05
by adi
Hello
I need to add to this code
one more color 0x080C0C

Can anyone help me ? ;)

~LButton::
while GetKeyState("LButton")
{
mousegetpos, xx, yy
PixelSearch, Px, Py, xx-10, yy-10, xx+10, yy+10, 0x29625F, 3, Fast
mousemove %Px%, %Py%, 0

}
return

Re: how to find two pixelcolors ?

Posted: 13 Jul 2018, 06:00
by Qysh
adi wrote:Hello
I need to add to this code
one more color 0x080C0C

Can anyone help me ? ;)

~LButton::
while GetKeyState("LButton")
{
mousegetpos, xx, yy
PixelSearch, Px, Py, xx-10, yy-10, xx+10, yy+10, 0x29625F, 3, Fast
mousemove %Px%, %Py%, 0

}
return

Code: Select all

~LButton::
while GetKeyState("LButton")
{
mousegetpos, xx, yy
PixelSearch, Px, Py, xx-10, yy-10, xx+10, yy+10, 0x29625F, 3, Fast
mousemove %Px%, %Py%, 0
PixelSearch, Px2, Py2, xx-10, yy-10, xx+10, yy+10, 0x080C0C, 3, Fast
mousemove %Px2%, %Py2%, 0
}
return

Re: how to find two pixelcolors ?

Posted: 13 Jul 2018, 09:25
by adi
this code search only one colors :)

Re: how to find two pixelcolors ?

Posted: 13 Jul 2018, 11:51
by adi
ok this code search two colors ,how did 3colors or 4colors ? :)

~LButton::
while GetKeyState("LButton")
{
mousegetpos, xx, yy
PixelSearch, Px, Py, xx-10, yy-10, xx+10, yy+10, 0x29625F, 3, Fast
if (ErrorLevel != 0)
PixelSearch, Px, Py, xx-10, yy-10, xx+10, yy+10, 0x0D2321, 3, Fast ; do this ONLY if previous search failed
if (ErrorLevel = 0)
NumberofPlayers++
mousemove %Px%, %Py%, 0
}
return