Skip to content

Commit 78feb45

Browse files
authored
PR #54: Auto Clicker Project
Add Auto Clicker project Merge pull request #54 from BasselDar/add-auto-clicker
2 parents c670834 + e1d4757 commit 78feb45

File tree

3 files changed

+95
-0
lines changed

3 files changed

+95
-0
lines changed

Auto-Clicker/README.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Auto Clicker
2+
3+
A Python automation tool that allows you to automatically click the mouse at rapid intervals. This is useful for repetitive clicking tasks and can be controlled via keyboard hotkeys.
4+
5+
## Features
6+
7+
- Start and stop automatic clicking with keyboard hotkeys
8+
- Adjustable click interval (currently set to 1ms between clicks)
9+
- Simple keyboard controls for easy on/off toggling
10+
- Minimal resource usage
11+
12+
## Requirements
13+
14+
- Python 3.x
15+
- pyautogui library
16+
- keyboard library
17+
18+
## Installation
19+
20+
Install the required dependencies using pip:
21+
22+
```bash
23+
pip install -r requirements.txt
24+
```
25+
26+
## How to Use
27+
28+
1. Run the script by executing the `auto_clicker.py` file:
29+
30+
```bash
31+
python auto_clicker.py
32+
```
33+
34+
2. The program will start and display instructions:
35+
- Press `'S'` to **start** the auto clicker
36+
- Press `'E'` to **stop** the auto clicker
37+
- Press `'Q'` to **quit** the program
38+
39+
3. Once started (by pressing 'S'), the auto clicker will automatically perform mouse clicks at the current cursor position at fixed intervals (Can be edited in the code).
40+
41+
4. Press 'E' to stop the clicking, and press 'Q' to exit the program entirely.
42+
43+
## Caution
44+
45+
⚠️ **WARNING**: Use this tool responsibly. Automated clicking can:
46+
- Interfere with other applications
47+
- Cause unintended actions if not carefully controlled
48+
- May violate terms of service for certain applications or games
49+
50+
Always ensure you have full control over what the auto clicker is doing before starting it.
51+
52+
## How It Works
53+
54+
The script uses the following libraries:
55+
56+
- **pyautogui**: For performing automated mouse clicks
57+
- **keyboard**: For detecting keyboard hotkey presses to control the clicker
58+
59+
The program runs in an infinite loop, continuously checking if the 'q' key is pressed (to exit) and performing clicks when the `clicking` flag is set to `True`.

Auto-Clicker/auto_clicker.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import pyautogui
2+
import keyboard
3+
import time
4+
5+
clicking = False
6+
7+
8+
def start_clicking():
9+
global clicking
10+
clicking = True
11+
print("Auto clicker started")
12+
13+
14+
def stop_clicking():
15+
global clicking
16+
clicking = False
17+
print("Auto clicker stopped")
18+
19+
20+
keyboard.add_hotkey("s", start_clicking)
21+
keyboard.add_hotkey("e", stop_clicking)
22+
23+
print("Press 'S' to start clicking")
24+
print("Press 'E' to stop clicking")
25+
print("Press 'Q' to quit")
26+
27+
while True:
28+
if clicking:
29+
pyautogui.click()
30+
time.sleep(0.001)
31+
32+
if keyboard.is_pressed("q"):
33+
print("Exiting program")
34+
break

Auto-Clicker/requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
pyautogui
2+
keyboard

0 commit comments

Comments
 (0)