check for colors in one pixelgetcolor

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Niuuwu
Posts: 11
Joined: 19 Nov 2020, 09:10

check for colors in one pixelgetcolor

28 Dec 2020, 16:22

As in title, i would like to check for multiple colors that are assigned in one variable, but it doesn't work.

Code: Select all

rcolors = 0x595142|0x595141|0x121352|0x131352

...

PixelGetColor, nowcolor, rx, ry
If (nowcolor = rcolors)
 Send {PgUp}
User avatar
Xtra
Posts: 2750
Joined: 02 Oct 2015, 12:15

Re: check for colors in one pixelgetcolor

28 Dec 2020, 17:06

Use: InStr()

Code: Select all

rcolors := "0x595142|0x595141|0x121352|0x131352"

PixelGetColor, nowcolor, rx, ry
If InStr(rcolors, nowcolor)
    Send {PgUp}

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: NinjoOnline and 223 guests