This project is an Auto Clicker tool written in Python. The script automates mouse clicking based on keyboard inputs. It uses the keyboard
library to detect key presses and the pyautogui
library to simulate mouse clicks. This tool can be particularly useful for repetitive tasks that require frequent mouse clicks.
- Toggle Mode: Press the
h
key to start clicking and press it again to stop. - Hold Mode: Press and hold the
h
key to continuously click the left mouse button. - Double Click Mode: Press and hold the
h
key to double click. - Random Click Mode: Press and hold the
h
key to click at random intervals. - Burst Mode: Press and hold the
h
key to click rapidly a specified number of times. - Stop Script: Press the
esc
key to stop the script entirely. - Human-like Delays: Introduce randomness in clicking delays using
--min-delay
and--max-delay
arguments.
main.py
: The main script that runs the auto clicker.get_scancode.py
: A helper script to retrieve scancode values for different keys.pyproject.toml
: Poetry configuration file.requirements.txt
: Lists the dependencies needed to run the project..gitignore
: Specifies files and directories to be ignored by Git.
-
Clone the repository:
git clone <repository-url> cd auto-clicker-main
-
Install Poetry:
curl -sSL https://install.python-poetry.org | python3 -
-
Install dependencies:
poetry install
-
Activate the virtual environment:
poetry shell
-
Clone the repository:
git clone <repository-url> cd auto-clicker-main
-
Create a virtual environment (optional but recommended):
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the required packages:
pip install -r requirements.txt
-
Run the script in default hold mode:
python main.py
-
Run the script in toggle mode:
python main.py toggle
-
Run the script in double click mode:
python main.py double
-
Run the script in random click mode:
python main.py random
-
Run the script in burst mode:
python main.py burst --burst-count 20
-
Run the script with custom delays:
python main.py --min-delay 0.01 --max-delay 0.1
-
Instructions:
- In toggle mode, press the
h
key to start clicking and press it again to stop. - In hold mode, press and hold the
h
key to start clicking. - In double click mode, press and hold the
h
key to double click. - In random click mode, press and hold the
h
key to click at random intervals. - In burst mode, press and hold the
h
key to click rapidly a specified number of times. - Press the
esc
key to stop the script in any mode. - Use
--min-delay
and--max-delay
to introduce randomness in the clicking delays to make the clicking more human-like.
- In toggle mode, press the
Here are a few suggestions to enhance the code quality and functionality, which can also help impress future employers:
-
Exception Handling:
- Add exception handling to manage unexpected errors gracefully.
-
Logging:
- Implement logging instead of print statements for better monitoring and debugging.
-
Configurable Parameters:
- Allow users to configure the keys and the delay time via command-line arguments or a configuration file.
This project is licensed under the MIT License - see the LICENSE file for details.