Python script that automatically clicks “Approve” or “Allow” buttons detected on screen. It can also be used to automatically click other icons or buttons.
- Create a virtualenv, activate it, and install
requirements.txt. - Make sure screen capture and mouse control permissions are granted (macOS: Accessibility access, Windows: run as a user with desktop access).
- Grab clear screenshots of the buttons you want to click and save them into the
scans/folder. - Supported formats: PNG, JPG, JPEG, BMP.
python watcher.py --images_dir scansKey arguments:
--images_dir PATH(required): folder that holds the template images (e.g.scans).--monitor INDEX(default: 1): monitor number frommss(1 is the primary display).--scales LIST(default: 0.9,1.0,1.1): comma-separated scale factors used when matching templates.--match FLOAT(default: 0.9): similarity threshold; lower values match more loosely.--poll SECONDS(default: 0.7): sleep time between screen grabs.--max_clicks INT(default: unlimited): stop after this many clicks.
Stop the watcher at any time with Ctrl+C.