A simple auto-clicker script with a GUI, allowing you to start and stop clicking at set intervals. Works on Windows, Mac, and Linux.
To get started with this auto-clicker, follow these steps:
It is recommended to create a virtual environment to keep your project dependencies isolated. To do this:
- Ensure you have Python >= 3.12 installed on your system.
- Open a terminal or command prompt and navigate to your project directory.
python -m venv venvThis will create a virtual environment in a folder named venv.
-
On Windows (Command Prompt):
venv\Scripts\activate
-
On macOS:
source venv/bin/activate
After activation, you'll see (venv) in your terminal, indicating that the environment is active.
Once the virtual environment is activated, you can install the required dependencies using pip:
pip install pyautogui
pip install pyinstaller # To compile the script into an executabletkinter is usually included by default in Python installations. However, if you encounter issues, follow the instructions below:
-
On macOS:
brew install python-tk
-
On Windows:
tkintershould be included with the default Python installation. No additional steps are necessary.
You can customize the settings of the auto-clicker by editing the main.py file. Note the following variables:
window_title = "Auto Clicker" # The title of the window
clicker_interval = 3 # Interval between clicks in seconds
footer_text = "This text will be shown at the bottom of the window." # Footer textModify these as needed to adjust the behavior or appearance of the application.
Once your environment is set up, you can run the auto-clicker with:
python main.pyThis will open the GUI, allowing you to start and stop the auto-clicking process.
To compile the script into a standalone executable:
- On Windows or macOS, run:
pyinstaller --onefile --windowed main.py
This will create an executable file:
- On Windows: You’ll get a
.exefile located in thedist/directory. - On macOS: You’ll get a
.appfile in thedist/directory.
If you're on macOS but need a Windows .exe file, you'll need to compile it on a Windows machine or use cross-compilation techniques (e.g., using a virtual machine or Docker).
Once you're done working in your virtual environment, you can deactivate it by running:
deactivateThis will return you to the system's default Python environment.
- Make sure to test your compiled executable on the target operating system to ensure everything works as expected.
- PyInstaller may raise some warnings during the build process, but these are typically harmless unless there's a specific error that prevents the build.
