How to make script that would detect if an area contains a pixel of a specific color and press key based on the color,
To be more precise, I need button A to be pressed when there is a red note in front of the line, and button D when there is a blue note.
You can make an example or a full-fledged script using this data:
Blue X, Y: 1140, 576
Blue color hex: #BDD6E7
Red X, Y: 1140, 496
Red color hex: #DEBBBA
Absolute newbie asks for help with PixelSearch/PixelGetColor
-
- Posts: 1
- Joined: 15 May 2024, 10:15
- CoffeeChaton
- Posts: 35
- Joined: 11 May 2024, 10:50
Re: Absolute newbie asks for help with PixelSearch/PixelGetColor
Code: Select all
#Requires AutoHotkey v1.1.33.11
~Space:: Script1(10)
Script1(sec) {
ms := sec *1000
i := ms / 10
loop % i {
PixelSearch, OutputVarX, OutputVarY, 1140, 576, 1141, 577, 0xBDD6E7, , Fast RGB
if (ErrorLevel = 0) {
Send, D
}
; Red X, Y: 1140, 496
; Red color hex: #DEBBBA
PixelSearch, OutputVarX, OutputVarY, 1140, 576, 1141, 577, 0xDEBBBA, , Fast RGB
if (ErrorLevel = 0) {
Send, A
}
Sleep, 10
}
}