WaitPixelColor()

Author: MasterFocus Last Modified: 20090719


Waits until pixel is a certain color (w/ optional timeout)

WaitPixelColor(p_DesiredColor,p_PosX,p_PosY,p_TimeOut=0,p_GetMode="",p_ReturnColor=0)

For more details of the functions's parameters and return value, please see it's source code.

Remarks

The library lacks an external documentation. The source contains a description. Look at the AutoHotkey command PixelGetColor for more information; it is based on it.

For update's details and remarks related to the functions, please see the AutoHotkey Forum: http://www.autohotkey.com/forum/topic43807.html

License

nonexistent

Example

; #Include WaitPixelColor.ahk
#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%

CoordMode, Pixel, Screen

MsgBox % "This example will wait 2 seconds, and then wait until at position x=640, y=480 the color changes to white."
Sleep, 2000
ExitCode := WaitPixelColor(0xFFFFFF, 640, 480, 20000)
If (ExitCode = 0)
{
    MsgBox The desired color was found
}
Else If (ExitCode = 1)
{
    MsgBox There was a problem during PixelGetColor
}
Else If (ExitCode = 2)
{
    MsgBox The function timed out
}