首页 > 白马西风 > AHK脚本-判断屏幕颜色
2023
12-02

AHK脚本-判断屏幕颜色

ctrl+alt+F12取得鼠标在屏幕上的坐标,按r判断坐标处的颜色,同时在屏幕上显示色块提示脚本运行状态。

End::Pause
Home::Suspend
^!F12::
MouseGetPos, MouseX, MouseY
MsgBox The Pos is %MouseX%, %MouseY%.
return

$r::
if not MouseX
    MsgBox Need to get Pos first.
else
    If auto = 1
    {
        auto = 0
        SetTimer, jineng, Off
        SplashImage,,X940 Y1020 H24 W60 CWFF0000 CT000000 ZX5 ZY5 B2 FS9 WS700, STOP
    }
    Else
    {
        auto = 1
        SetTimer, jineng, 200
        SplashImage,,X940 Y1020 H24 W60 CW00FF00 CT000000 ZX5 ZY5 B2 FS9 WS700, AUTO
    }
    return
return

jineng:
PixelGetColor, jinengcolor, %MouseX%, %MouseY%, RGB
{
    if jinengcolor = 0x000050
    {
        Send {F1}
        Random, stime, 10, 80
        Sleep, %stime%
        return
    }
    if jinengcolor = 0x0000FF
    {
        Send {F2}
        Random, stime, 10, 80
        Sleep, %stime%
        return
    }
    if jinengcolor = 0x005000
    {
        Send {F3}
        Random, stime, 10, 80
        Sleep, %stime%
        return
    }
    if jinengcolor = 0x05050
    {
        Send {F4}
        Random, stime, 10, 80
        Sleep, %stime%
        return
    }
    if jinengcolor = 0x0050FF
    {
        Send {F5}
        Random, stime, 10, 80
        Sleep, %stime%
        return
    }
    if jinengcolor = 0x00FFFF
    {
        Send {F6}
        Random, stime, 10, 80
        Sleep, %stime%
        return
    }
    if jinengcolor = 0x500000
    {
        Send {F7}
        Random, stime, 10, 80
        Sleep, %stime%
        return
    }
    if jinengcolor = 0x505050
    {
        Send {F8}
        Random, stime, 10, 80
        Sleep, %stime%
        return
    }
    if jinengcolor = 0xFF00FF
    {
        Send {F9}
        Random, stime, 10, 80
        Sleep, %stime%
        return
    }
    if jinengcolor = 0xFF5000
    {
        Send {F10}
        Random, stime, 10, 80
        Sleep, %stime%
        return
    }
    if jinengcolor = 0xFF5050
    {
        Send {F11}
        Random, stime, 10, 80
        Sleep, %stime%
        return
    }
    if jinengcolor = 0xFFFF00
    {
        Send {F12}
        Random, stime, 10, 80
        Sleep, %stime%
        return
    }
}
return

 

觉得文章有用,微信打赏一元。



留下一个回复

你的email不会被公开。