check for colors in one pixelgetcolor

Get help with using AutoHotkey and its commands and hotkeys
Niuuwu
Posts: 10
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: 2055
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”

Who is online

Users browsing this forum: DataLife, djuga, Google [Bot], songdg, Xeo786 and 31 guests