Skip to content

Conditional clicking: only click while a pixel matches a color #80

Closed

Description

@TMHSDigital

Why it matters

A bigger bet that turns a timer-driven clicker into a light, safe automation tool: only click when the screen shows what you expect. Examples: click "Continue" only when its pixel turns green, stop when a progress bar's end pixel changes, click only while a dialog is visible. It also improves safety, because a run stops doing harm when the target UI goes away (window closed, layout changed) instead of clicking blindly.

Rationale

  • PyAutoGUI (via PyScreeze, already a locked dependency) provides pixel() / pixelMatchesColor(); reading one pixel is cheap.
  • The picker overlay already knows the exact screen point; it can sample the color at pick time.
  • The engine has a natural hook: a check before _perform_burst, similar to _should_pause_for_foreground.

Suggested approach

  1. Optional condition per run (and later per sequence step): "pixel at (x, y) matches color C within tolerance T".
  2. Behavior when it does not match: wait (pause, shown as a Paused status) or stop (end with a clear reason, e.g. "Stopped: target changed").
  3. UI: an "Only when..." row in Advanced with a "Sample color" button that reuses the picker and shows a swatch.
  4. Keep the check rate-limited and measured so it does not hurt high-cps runs; note the cost in docs/PERFORMANCE.md.

Done when

  • A user can pick a point, sample its color, and have clicking pause or stop when that pixel changes, with tests that mock pixel() and cover both behaviors.

Activity

  1. added
    enhancement
    priority: low
    feature
    on Oct 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementfeaturepriority: low

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions