This is my short script for a game, it'll click whenever it detects a specific pixel color above another specific pixel color. The thing is the said pixel is moving quite fast, and the script sometimes runs slow, so it reads the first pixel, then the second, but meanwhile the first pixel is no longer to the correct position and it'll still click.IfWinActive, Legends Of Idleon
{
fy := 0
fx := 0
Loop
{
CoordMode, Pixel, Window
PixelSearch, fx, fy, 670, 450, 1334, 559, 0xB1E63B, 0, Fast RGB
}
Until ErrorLevel = 0
ffy := fy + 37
If (ErrorLevel = 0)
{
CoordMode, Pixel, Window
PixelSearch, FoundX, FoundY, %fx%, %ffy%, %fx%, %ffy%, 0xFCFF7A, 0, Fast RGB
""NEED TIME READING HERE""
If (ErrorLevel = 0)
{
Click, Left, 1
Sleep, 10
}
}
}
I'm looking for a way to either accelerate the pixel reading thing (but I don't trust this) or, better, a way to count how many ms did pass since the first pixel was read, so it doesn't click if we're more than 100ms after the pixelsearch.
I can't figure out what function could do this, please help me :$