I found this on the web. It doesn't work 100% but if someone could fix it
Code: Select all
#NoEnv
CheckPixelColors()
{
; Check the color of pixel a1
PixelGetColor, a1, 953, 577, RGB
If (IsColorInRange(a1, 0xFFFFFD, 10))
{
SendInput "{1 down}" ; Press 1 down key.
SendInput "{1 up}" ; Release 1 up key.
Sleep 1000
}
; Check the color of pixel a2
PixelGetColor, a2, 947, 608, RGB
If (IsColorInRange(a2, 0xFEFFFF, 10))
{
SendInput "{2 down}" ; Press 2 down
SendInput "{2 up}" ; Release "2
Sleep 1000
}
; Check the color of pixel a3
PixelGetColor, a3, 947, 603, RGB
If (IsColorInRange(a3, 0xFCFFFF, 10))
{
SendInput "{3 down}" ; Press 3
SendInput "{3 up}" ; Release 3
Sleep 1000
}
; Check the color of pixel a4
PixelGetColor, a4, 945, 598, RGB
If (IsColorInRange(a4, 0xFFFEFF, 10))
{
SendInput "{4 down}" ; Press 4
SendInput "{4 up}" ; Release 4
Sleep 1000
}
}
IsColorInRange(color, targetColor, tolerance)
{
redDiff := Abs(GetRed(color) - GetRed(targetColor))
greenDiff := Abs(GetGreen(color) - GetGreen(targetColor))
blueDiff := Abs(GetBlue(color) - GetBlue(targetColor))
return (redDiff <= tolerance && greenDiff <= tolerance && blueDiff <= tolerance)
}
GetRed(color) {
return (color >> 16) & 0xFF
}
GetGreen(color) {
return (color >> 8) & 0xFF
}
GetBlue(color) {
return color & 0xFF
}
F3::
{
CoordMode, Pixel, Screen
CoordMode, Mouse, Screen
CoordMode, ToolTip
ToolTip iniciou, 1100, 700, +AlwaysOnTop
Loop
{
PixelSearch FoundXa, FoundYa, 1029, 592, 964, 661, 0x068F6C , 16, Fast RGB ;direita coluna
If (ErrorLevel = 0)
{
ToolTip . ,FoundXa,FoundYa, +AlwaysOnTop
; Check the color next to the movable bar
PixelGetColor NextToGreen, FoundXa, FoundYa, RGB
If (IsColorInRange(NextToGreen,0x36DAB0 , 69))
{
CheckPixelColors()
continue
} }
else
{
Sleep 20
}
}
}
Return
f9::Reload