Basic noob question #if Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
KawaiiNya
Posts: 1
Joined: 16 May 2019, 16:53

Basic noob question #if

16 May 2019, 17:08

Well im new to AHK and wonder can i do something like this?

Code: Select all

#if WinActive("ahk_class Window") 
#if PixelGetColor, color, 1, 1, RGB == 0xffffff
a::b
#if PixelGetColor, color, 1, 1, RGB == 0x000000
a::c
#if PixelGetColor, color, 1, 1, RGB == 0xaaaaaa
a::d
and so on...
User avatar
Cuadrix
Posts: 199
Joined: 07 May 2017, 08:26

Re: Basic noob question #if

16 May 2019, 17:24

Why not try first, then ask?
----
swagfag
Posts: 2756
Joined: 11 Jan 2017, 17:59

Re: Basic noob question #if  Topic is solved

16 May 2019, 17:24

yes

Code: Select all

#If WinActive("ahk_class Window") && pixelGetColor(1, 1, 0xffffff)
a::b
#If WinActive("ahk_class Window") && pixelGetColor(1, 1, 0x000000)
a::c
#If WinActive("ahk_class Window") && pixelGetColor(1, 1, 0xaaaaaa)
a::d

pixelGetColor(x, y, color) {
	PixelGetColor c, x, y, RGB
	return c = color
}

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], ilhom, JoeWinograd and 171 guests