A simple and easy-to-use Windows desktop automatic mouse clicking tool.
- Set click interval (supports milliseconds and seconds)
- Choose click type: left click, right click, left double-click
- Choose click position: current mouse position or fixed coordinates
- Real-time display of click status and count
- Fail-safe: move mouse to top-left corner of screen to stop the program
- Built-in library: Comes with Python, no need to install additional GUI dependencies
- Lightweight: Small program size, fast startup
- Cross-platform: Although this tool is primarily for Windows, the code can run on other systems
- Easy to package: Fewer dependencies when packaging with PyInstaller
This program uses Tkinter's after() method to implement timed clicking instead of multi-threading. This approach:
- Executes in the main thread, avoiding thread safety issues
- Does not block the GUI
- Makes code simpler and easier to maintain
Ensure Python 3.7 or higher is installed. Check in Command Prompt:
python --versionOpen Command Prompt (CMD) or PowerShell and run:
pip install pyautogui pyinstallerOr use requirements.txt:
pip install -r requirements.txtDependencies:
pyautogui: For controlling mouse clickspyinstaller: For packaging into exe filestkinter: Built into Python, no installation needed
In the project directory, execute:
python auto_clicker.py- Set click interval: Enter a number and select the unit (milliseconds/seconds)
- Choose click type: Left click, right click, or left double-click
- Set click position:
- Check "Use current mouse position": Uses real-time mouse position when clicking
- Uncheck: Enter fixed X, Y coordinates
- Click "Start": Begin auto-clicking
- Click "Stop": Stop auto-clicking
Safety tip: Quickly move the mouse to the top-left corner of the screen to trigger fail-safe and automatically stop clicking.
pyinstaller --onefile --windowed --name "AutoClicker" auto_clicker.pyParameter descriptions:
--onefile: Package into a single exe file--windowed: Don't show console window when running--name: Specify the generated exe file name
If you have an .ico icon file:
pyinstaller --onefile --windowed --name "AutoClicker" --icon=icon.ico auto_clicker.pyAfter packaging is complete, the exe file is located at:
dist/AutoClicker.exe
rmdir /s /q build
del AutoClicker.specCopy dist/AutoClicker.exe to any Windows computer to run it without installing Python.
- Windows 10 or higher
- No dependencies required
- Antivirus software: Some antivirus software may flag false positives; you may need to add it to the trusted list
- Administrator privileges: Some applications may require running the auto-clicker as administrator to click
- Screen scaling: If using fixed coordinates, note that Windows display scaling settings may affect coordinates
- Check if the target window requires administrator privileges
- Try running the auto-clicker as administrator
Check the scaling ratio in Windows Display Settings; it's recommended to set it to 100%.
Quickly move the mouse to the top-left corner of the screen (near position 0,0) to trigger fail-safe.
AutoClickerLite/
├── auto_clicker.py # Main program source code
├── requirements.txt # Python dependency list
└── README.md # Documentation
MIT License