Overview
This prompt aims to generate an AutoHotkey script for automating mouse and keyboard actions. Programmers and coders seeking automation solutions will benefit from this script.
Prompt Overview
Purpose: This script automates mouse and keyboard actions for repetitive tasks.
Audience: It is designed for programmers and users seeking to enhance productivity with automation.
Distinctive Feature: The script runs indefinitely until a designated hotkey, like ESC, is pressed to stop it.
Outcome: Users can efficiently execute repetitive tasks without manual intervention, saving time and effort.
Quick Specs
- Media: Text
- Use case: Generation
- Industry: Development Tools & DevOps, General Business Operations, Productivity & Workflow
- Techniques: Function Calling / Tool Use, Role/Persona Prompting, Structured Output
- Models: Claude 3.5 Sonnet, Gemini 2.0 Flash, GPT-4o, Llama 3.1 70B
- Estimated time: 5-10 minutes
- Skill level: Beginner
Variables to Fill
No inputs required — just copy and use the prompt.
Example Variables Block
No example values needed for this prompt.
The Prompt
Create an AutoHotkey (AHK) script that continuously automates the following sequence until manually stopped:
1. Hold down the right mouse button.
2. Wait for 1 second.
3. Simulate pressing the ‘f’ key once.
4. Release the right mouse button.
Ensure the script runs in a loop performing these steps repeatedly and can be stopped via a convenient hotkey (such as ESC).
# Steps
– Begin a loop that runs indefinitely.
– Within the loop:
– Send a press down event for the right mouse button.
– Wait for 1,000 milliseconds.
– Send a single press of the ‘f’ key.
– Release the right mouse button.
– Continue looping until the stop hotkey is triggered.
# Output Format
Provide the complete AutoHotkey script code that implements the described functionality, including:
– Comments explaining each part.
– The chosen stop hotkey.
# Notes
– Use AutoHotkey syntax properly for mouse and keyboard events.
– Ensure the script gracefully stops when the stop hotkey is pressed.
– The script should minimize interference with other system operations as much as possible.
Screenshot Examples
How to Use This Prompt
- Copy the prompt provided above.
- Open your AutoHotkey editor or text editor.
- Paste the copied prompt into the editor.
- Modify the prompt if necessary for your needs.
- Run the script using AutoHotkey.
- Press the designated stop hotkey to stop the script.
Tips for Best Results
- Use a Loop: Implement an infinite loop to repeat actions until a stop command is issued.
- Mouse and Keyboard Events: Utilize AHK commands to simulate mouse button presses and keyboard strokes effectively.
- Implement a Stop Hotkey: Choose a convenient key, like ESC, to allow users to halt the script easily.
- Include Comments: Add comments in the script for clarity, explaining each step of the automation process.
FAQ
- What is AutoHotkey used for?
AutoHotkey is used for automating repetitive tasks on Windows, such as keyboard shortcuts and mouse actions. - How do you create a loop in AutoHotkey?
You can create a loop using ‘Loop’ or ‘While’ statements to repeat actions indefinitely or until a condition is met. - What does ‘Send’ do in AutoHotkey?
‘Send’ simulates keystrokes or mouse clicks, allowing you to automate input in applications. - How can you stop an AutoHotkey script?
You can stop an AutoHotkey script using a designated hotkey, like ESC, to break the loop.
Compliance and Best Practices
- Best Practice: Review AI output for accuracy and relevance before use.
- Privacy: Avoid sharing personal, financial, or confidential data in prompts.
- Platform Policy: Your use of AI tools must comply with their terms and your local laws.
Revision History
- Version 1.0 (February 2026): Initial release.


