# AntiGravity Submit Helper A Windows desktop automation utility built with AutoHotkey v2 to detect and interact with the Submit control in the AntiGravity desktop application using screen-level pixel detection. ## Architecture & Workflow The utility uses pixel-color detection rather than window-text extraction because the AntiGravity interface is embedded within a `Chrome Legacy Window`, making conventional DOM inspection unreliable. ```mermaid flowchart TD A[User enables helper F10] --> B{Is AntiGravity active?} B -- No --> C[Wait] B -- Yes --> D[Scan restricted screen region] D --> E{Blue Submit region detected?} E -- No --> C E -- Yes --> F[Wait 5-second safety delay] F --> G{Helper still enabled & AntiGravity active?} G -- No --> H[Cancel Submission] G -- Yes --> I[Re-verify Submit region] I --> J[Click Submit button] ``` ## Requirements - **OS:** Windows 10+ - **Runtime:** AutoHotkey v2.0+ (AutoHotkey v1 is not supported) - **Target:** AntiGravity desktop application ## Installation & Usage 1. **Install AutoHotkey v2** on your system. 2. **Clone the repository:** ```bash git clone https://github.com/sahajasakhunala/AntiGravity-Submit-Helper.git ``` 3. **Run the script:** Double-click `AntiGravityHelper.ahk`. It runs in the background without a GUI. ### Keyboard Controls | Key | Action | Description | |-----|--------|-------------| | **F10** | Toggle Automation | Enables or disables the helper detection loop. | | **F12** | Emergency Stop | Immediately terminates the AutoHotkey script process. | ## Safety Mechanisms Desktop automation requires strict boundaries. This script implements several safety layers: 1. **Application Restriction:** Only operates when `Antigravity.exe` is the active window. 2. **Restricted Search Region:** Scans only a specific coordinate bounding box (default: `X:1580-1725, Y:925-995`). 3. **Horizontal Run Validation:** Requires ~60+ consecutive blue pixels to prevent false positives from isolated blue UI elements. 4. **Safety Delay:** Imposes a 5-second waiting period between detection and clicking, allowing manual cancellation via `F10`. 5. **Pre-click Revalidation:** Verifies the Submit button is still present immediately before clicking. ## Configuration & Calibration Detection relies on absolute screen coordinates and may require calibration if your display scaling, resolution, or AntiGravity window position changes. To adjust the detection region, edit the following variables in `AntiGravityHelper.ahk`: ```ahk left := 1580 top := 925 right := 1725 bottom := 995 ``` A tighter bounding box minimizes false positives. Display scaling in Windows (e.g., 125%, 150%) will shift physical pixel coordinates and may necessitate recalibration. ## Engineering Notes For a detailed breakdown of the development process, including major issues encountered and how they were resolved, please refer to the [Engineering Notes](docs/ENGINEERING_NOTES.md).