Dev.to · 2 min read

I Built a Lightweight Macro Recorder in Rust (Mostly with an AI Agent)

I Built a Lightweight Macro Recorder in Rust (Mostly with an AI Agent)

I got tired of closed-source macro tools. Most of them store macros in binary formats, have poor DPI awareness, and install global keyboard hooks. For a tool that essentially injects input, closed source felt uncomfortable. So I wrote my own. What it is Single ~7 MB .exe, no installer MIT license Macros are plain JSON (easy to edit and diff) Small scripting layer on top: If / While, variables, and screen conditions How it finds UI elements Four approaches, ordered from cheapest to most expensive: Windows UI Automation by name No coordinates, no thresholds. Works well for normal desktop apps. Almost useless in games that draw their own UI. Image search You paste a screenshot snippet (Win+Shift+S). I added the ability to restrict the search area. On my 1440p monitor this dropped the average step from ~78 ms to ~7 ms. OCR via the built-in Windows engine No external models to download. Fixed coordinates DPI-aware and anchored to the target window. AI involvement The majority of the code was written with an AI agent. I directed the architecture, reviewed every part, fixed the non-trivial pieces (especially the image-search optimization and proper DPI handling), and made the design decisions. The final codebase is still normal, readable Rust. Limitations (being honest) Windows only SendInput can be detected by some anti-cheats Global hooks + synthetic input look like a keylogger to many antivirus products. The repository contains VirusTotal results instead of pretending otherwise. No telemetry, no accounts, no ads. I’m mainly looking for feedback on the architecture and any better approaches for the image search / OCR parts. The repository is public: [https://github.com/blackixxce12/macro-recorder]

This is a summary aggregated from Dev.to. Read the complete article on the original site:

Read full article at Dev.to

More AI & Machine Learning News