A simple yet powerful Python-based auto clicker that automates mouse clicks at specific screen coordinates using the pyautogui
library. Perfect for automating repetitive clicking tasks with precision and control.
- π― Precise Clicking - Click on up to 3 pre-defined screen positions
- β±οΈ Customizable Delays - Set custom intervals between clicks
- π Repeat Control - Specify exact number of click repetitions
- π Coordinate Helper - Built-in tool to capture mouse coordinates
- π‘οΈ Safety Features - Built-in failsafes to prevent accidents
- π₯οΈ Cross-Platform - Works on Windows, macOS, and Linux
- Python 3.6 or higher
- pip package manager
-
Clone the repository:
git clone https://github.com/MRAbbasi1/auto-clicker-python.git cd auto-clicker-python
-
Install dependencies:
Option 1: Direct installation
pip install pyautogui
Option 2: Using requirements file (Recommended)
pip install -r requirements.txt
Option 3: Using virtual environment (Best Practice)
# Create virtual environment python -m venv venv # Activate virtual environment source venv/bin/activate # On Windows: venv\Scripts\activate # Install dependencies pip install -r requirements.txt
python3 get_mouse_position.py
- Move your mouse to the desired clicking position within 5 seconds
- The script will display the coordinates (x, y) in the terminal
- Repeat for multiple positions if needed
python3 auto_clicker.py
auto-clicker-python/
βββ auto_clicker.py # Main auto-clicker script
βββ get_mouse_position.py # Coordinate capture utility
βββ requirements.txt # Python dependencies
βββ README.md # Project documentation
βββ LICENSE # MIT License
βββ .gitignore # Git ignore rules
Edit the coordinates in auto_clicker.py
:
# Define your target coordinates
positions = [
(100, 200), # Position 1 (x, y)
(300, 400), # Position 2 (x, y)
(500, 600) # Position 3 (x, y)
]
# Customize these parameters
CLICK_DELAY = 1.0 # Seconds between clicks
REPEAT_COUNT = 10 # Number of times to repeat
CLICK_DURATION = 0.1 # Click hold duration
- Failsafe Protection: Move mouse to top-left corner to emergency stop
- Coordinate Validation: Ensures click positions are within screen bounds
- Error Handling: Graceful handling of exceptions and interruptions
- Pre-execution Delay: 3-second countdown before starting clicks
python3 auto_clicker.py --delay 0.5 --repeat 20 --position 100,200
Ctrl+C
: Emergency stop during execution- Mouse movement to
(0,0)
: Automatic failsafe trigger
- Software Testing: Automated UI testing and regression testing
- Game Automation: Farming, idle games, and repetitive tasks
- Productivity: Automating repetitive office tasks
- Web Scraping: Automated form filling and data collection
- Accessibility: Assistance for users with motor difficulties
Educational Use Only: This tool is designed for educational purposes and legitimate automation tasks.
- β Do not use to violate terms of service of any application or game
- β Do not use for malicious purposes or unauthorized access
- β Do not use to gain unfair advantages in competitive environments
- β Always respect application policies and user agreements
- β Use responsibly and ethically
Issue: ModuleNotFoundError: No module named 'pyautogui'
# Solution
pip install --upgrade pyautogui
Issue: Permission denied on macOS
# Solution: Grant accessibility permissions
System Preferences > Security & Privacy > Accessibility
Issue: Clicks not registering
- Ensure coordinates are correct using
get_mouse_position.py
- Check if target application is in focus
- Verify screen resolution hasn't changed
- Use appropriate delays to avoid overwhelming target applications
- Test with small repeat counts first
- Monitor system resources during execution
Contributions are welcome! Here's how you can help:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
# Clone your fork
git clone https://github.com/YOUR_USERNAME/auto-clicker-python.git
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install development dependencies
pip install -r requirements-dev.txt
This project is licensed under the MIT License - see the LICENSE file for details.
- PyAutoGUI - For the excellent automation library
- Python community for continuous support and resources
- Contributors who help improve this project
- π Bug Reports: Create an issue
- π‘ Feature Requests: Create an issue
- π§ Contact: Open an issue for any questions
Made with β€οΈ by MRAbbasi1
β Star this repository if it helped you! β