Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions autoclicker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# AutoClicker
This is a basic autoclicker, you can choose the delay you want between each click.
## Prerequisites

**Python 3.8.x**

Install the requirements:

`python -m pip install -r requirements.txt --user`

Then you can run the script!

## Controls
Key | Action
--- | ---
F1 | Resume / Pause
ESC | Exit the program
57 changes: 57 additions & 0 deletions autoclicker/autoclicker.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import pyautogui
from pynput.keyboard import Key, Listener

# ======== Controls ========
start_or_pause_key = Key.f1
exit_key = Key.esc
delay = 1 # seconds

# ==== global variables ====
pause = True
running = True


def display_controls():

print("F1 = Start / Pause")
print("ESC = Exit\n")


def choose_delay():

try:
return float(input("Enter wanted delay (seconds): "))
except ValueError:
print(f"You did not give a valid input, default delay : {delay}sec")
return delay


def key_press(key):
global running, pause

if key == start_or_pause_key:
pause = not pause
print("< Pause >") if pause else print("< Start >")
elif key == exit_key:
running = False
print("< Exit >")


def main():

delay = choose_delay()
print(f"delay = {str(delay)}sec\n")
display_controls()

listener = Listener(on_press=key_press)
listener.start()

while running:
if not pause:
pyautogui.click(pyautogui.position())
pyautogui.PAUSE = delay
listener.stop()


if __name__ == "__main__":
main()
2 changes: 2 additions & 0 deletions autoclicker/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pyautogui
pynput