Code: Select all
#SingleInstance, Force
CoordMode, Pixel, Screen
Loop
{
If WinActive("Tibia")
{
PixelGetColor, Life20, 255, 0, RGB
PixelGetColor, RingWorn, 1209, 272, RGB
if (Life30 != 0xDB4F4F && RingWorn != 0x59E7B4) ; life is less than 20% and ring is not worn
Send, {Home} ; put ring on
PixelGetColor, Life90, 255, 0, RGB
PixelGetColor, RingWorn, 1209, 272, RGB
if (Life70 = 0xDB4F4F && RingWorn = 0x59E7B4) ; life is at least 70% and ring is worn
Send, {Home} ; remove ring
}
Sleep, 2500
}
Return