修改AHK脚本:
现在逻辑:按4时,按取色逻辑输入F1-F4.
目标逻辑:按4时,按颜色取F1或者F2; 按5时,按颜色取F3或者F4.
下为提供脚本
4::
if (a := !a)
{
SetTimer, TagCX, 1
}
else
{
SetTimer, TagCX, Off
}
Return
TagCX:
CoordMode, Pixel, Screen
if (GetColor(1352, 979) = “f39c”)
{
send {F1}
}
else if (GetColor(1352, 979) = “1c37”)
{
send {F2}
}
else if (GetColor(1373, 981) = “f7cb”)
{
send {F3}
}
else if (GetColor(1379, 993) = “b06e”)
{
send {F4}
}
GetKeyState, state, 2, P
if state = U
{
SetTimer, TagCX, Off ; 停止运行宏命令
}
Return
GetColor(x, y)
{
CoordMode, Pixel, Screen
PixelGetColor, color, x, y, RGB
StringRight, color, color, 4 ; 截取颜色值后四位
return color
}