Wait for Pixel Action Icon

Wait for Pixel

Declaration

<AMWAITFORPOINTER ACTION="text [options]" XPOS="list" YPOS="list" COLOR="list">

See Also

Pause Task | Wait for File | Wait for Pixel | Wait for Pointer | Wait for Process | Wait for Window | Stop Timer | Read Timer  | Start Timer

Description

Causes task execution to pause at the current line until the specified pixel(s) match(es) or differ(s) the color value(s) specified.

Practical Usage

Commonly used to wait for a graphic or area of the screen to match (or stop matching) a "checksum" of pixel colors. Very useful for detecting subtle changes in a window's contents that cannot be measure by any other means. In visual mode, it is easy to create the checksum values, while in the properties of the action, simply move the mouse pointer around the target window while repeatedly pressing the INSERT key.

Parameters

General Properties

Property

Type

Req'd

Default

Markup

Description

Action

Text (options)

Yes

Match

ACTION="differ"

Specifies whether to wait for the pixel(s) to match the specified color(s), differ from the specified color(s), or change to any other color. The available options are:

  • Wait for pixel(s) to match: Wait until the pixel color(s) match the pixel(s) specified in the corresponding XPOS, YPOS and COLOR parameter.

  • Wait for pixel(s) to differ from: Wait until the pixel color(s) do not match all of the pixel(s) specified in the corresponding XPOS, YPOS and COLOR parameter.

  • Wait for pixel(s) to change color: Wait until (at least one of) the pixel(s) change(s) color from the colors of the specified pixel(s) at the time the step begins execution.

XPos

Number

Yes

(Empty)

XPOS="36"

The X coordinate of the pixel(s) to watch for. Multiple pixels/color pairs may be specified by separating the entries with commas. Move the cursor to the desired location and press the INSERT key to capture an X/Y position and color. All parameters must have the same number of items specified (unless the Action parameter is set to Wait for pixels to change color, in which case, color is omitted).

YPos

Number

Yes

(Empty)

YPOS="38"

The Y coordinate of the pixel(s) to watch for. Multiple pixels/color pairs may be specified by separating the entries with commas. Move the cursor to the desired location and press the INSERT key to capture an X/Y position and color. All parameters must have the same number of items specified (unless the Action parameter is set to Wait for pixels to change color, in which case, color is omitted).

Color

Number

Yes

(Empty)

COLOR="13160660"

The color(s) that the corresponding pixels specified in XPOS and YPOS should be. Multiple pixels/color pairs may be specified by separating the entries with commas. Move the cursor to the desired location and press the INSERT key to capture an X/Y position and color. All parameters must have the same number of items specified (unless the Action parameter is set to Wait for pixels to change color, in which case, color is omitted).

Coordinates relative to foreground window/screen

Yes/No

No

Yes

RELATIVE="NO"

Specifies whether coordinates should be relative to the foreground window or the screen.

Description Properties

The Description tab allows you to customize the text description of any step as it appears in the Task Builder's Steps Pane.

More on setting custom step description

Error Causes Properties

The Error Causes tab properties lets you instruct a task step to react only to specific errors or ignore certain errors that should cause it to fail.

More on Error Causes properties

On Error Properties

The On Error tab properties lets you determine what the task should do if a particular step encounters an error as defined in the Error Causes properties.

More about On Error properties

Additional Notes

Expressions, Variables & Functions

A percent sign is used as a special character in AutoMate to indicate the beginning and end of an expression. This allows variables, functions and other expressions to be entered in any text parameter of a task's properties. For example: %1+1% inside a task will resolve to 2 at runtime. A more elaborate example is %FileDateTime(myFile)% which results to the date/time of myFile. To help construct expressions, you can open Expression Builder by clicking the Insert Expression (%) button or by pressing F2.

More on expressions

More on variables

More on functions

More on extended functions
More on the expression builder

Example

NOTE: The code below can be copied and pasted directly into the Steps pane of the Task Builder.

 

Sample 1 - Wait for pixels to match.

 

<AMWAITFORPIXEL XPOS="260" YPOS="297" COLOR="16777215" />

 

 

Sample 2 - Wait for pixels to differ.

 

<AMWAITFORPIXEL ACTION="differ" XPOS="260" YPOS="297" COLOR="16777215" />

 

 

 

Sample 3 - Wait for pixels to change color.

 

<AMWAITFORPIXEL ACTION="any" XPOS="260" YPOS="297" />

 

↑ Top of Page