Guide · PuppyMacro 1.26.0

Conditions on the screen

A macro can look at the screen before it goes on: an If checks one or more conditions, waits for them as you choose, then plays the actions in its Then, or the actions in its Else, or stops the macro. A click inside Then can go where an image or a text was found, wherever it is that time.

The condition window of an If with a Pixel color condition that waits up to 30 seconds
A condition says what PuppyMacro sees now, as you change it.

Add a condition

  1. In the macro editor, select where the If goes (as for a new action), then select Condition (the + button next to Action) and choose Pixel color, Image on screen or Text on screen (OCR).
  2. The condition window opens with that condition. Pick the pixel, take the image or write the text (below), then choose when to run Then.
  3. Select Save. In the list, the If is a row with Then under it (and Else when the If runs it). Select Then or Else and add actions: they go at its end. You can also drag actions onto them. Alt+Up / Alt+Down at the top or bottom of a Then or Else move the actions out of it, and pass over an If instead of entering it.

Edit, or a double-click on the If or on its Then or Else, opens the condition window again. Add condition in that window adds more conditions to the same If, and each one has Remove condition. An If can be inside another If's Then or Else, and groups work inside them too.

The conditions

Each kind has its strengths. A pixel is the fastest and uses almost nothing, but breaks when the color shifts a little (light, effects, a highlight under the pointer). An image is the most reliable when it is small and distinctive, like a button or an icon; an area of one flat color can't be found as an image (a pixel fits it). A text is the slowest, and reads only the languages Windows has on the PC.

Each condition starts with True when: what it looks for is there (The pixel has this color, The image is on the screen, The text is on the screen, the default) or it is not (The pixel doesn't have this color, The image isn't on the screen, The text isn't on the screen), for example to wait until a window closes or a loading icon goes away. With Up to or As long as it takes, such a condition waits for it to go away. A part of the screen PuppyMacro cannot see (no monitor there any more) never makes it true. It finds nothing, so the actions in Then cannot go where it was found: while one of them does, it stays on "is on the screen".

Image and Text conditions have a Name (for example Accept button), which the actions in Then use. Two conditions of one macro cannot have the same name.

Where to look

When to run Then

Each condition has Now on the screen, which says what PuppyMacro sees a moment after you change it: Found now at 1812, 1210, 97% similar, how far the pixel's color is, or what text it read. Opening a condition does not check it: until then the card says Not checked yet. Check again (its ⟳ button) checks that condition on the screen as it is now, and Test in the condition window checks all of them, without playing any action. If it sees only black, the app may block screen capture or run in exclusive fullscreen: use its borderless or windowed mode.

When a click or a move does nothing

The If is true and its Then plays, but the mouse does not move or click: the app in front probably runs as administrator (Task Manager usually does, and so do many installers and some games). Windows then drops the keys and the mouse input PuppyMacro sends, without any error. Bring another app to the front, or run PuppyMacro as administrator too (see Good to know).

Click where it was found

Inside Then, a Click, Mouse button down, Mouse button up or Move to has a Position list: Fixed point, with its Point under it, or Where … was found for each Image or Text condition of the Ifs around it (not those true when it isn't on the screen). It then goes to the center of what that condition found this time, moved by Move from the center (pixels to the right and down; negative numbers go left or up). With One of them is true, an action that goes where a condition that was not found is skipped. Moved out of that If's Then, the action can't be saved until it goes back inside or gets a fixed point.

Examples

Checks per second

A macro with an If has Checks per second in the editor: how many times a second its conditions look at the screen while they wait (10, 30 by default, 60, or Every frame). Fewer checks leave more of the computer to other programs, more checks notice a change sooner. The macro's duration in the editor shows the shortest and the longest time, or "or more" when a condition waits as long as it takes.

Screen recognition

Settings > Screen recognition > Look for images with: Automatic (the graphics card for large areas, the processor for small ones, usually the fastest), Graphics card or Processor.

Images and your data

The images of the conditions are kept in the images folder of the data folder, are in every backup and go with the macros you share. An image no macro uses any more is deleted when a macro is saved; the History keeps a copy, so Restore this version brings it back.