Last active
April 25, 2019 16:33
-
-
Save sotlucas/d633185b19267fb6f088bbb52cdd3946 to your computer and use it in GitHub Desktop.
Simple autoclicker. Dependencies in comment.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pyautogui | |
| import keyboard | |
| import sys | |
| # Change this to whatever shortcut you want | |
| start_shortcut = 'alt+x' | |
| stop_shortcut = 'esc' | |
| def info(): | |
| print(f'Press {start_shortcut} to start') | |
| print(f'Press {stop_shortcut} to stop.') | |
| def on_pressed(): | |
| running = True | |
| while running: | |
| pyautogui.click() | |
| # TODO: implement a way to control time between clicks | |
| if keyboard.is_pressed(stop_shortcut): | |
| running = False | |
| info() | |
| keyboard.add_hotkey(start_shortcut, on_pressed) | |
| keyboard.wait() |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It needs the following modules:
pip3 install pyautoguipip3 install keyboardTo run it you first need to enter:
xhost +(not totally sure why though)and then
sudo python3 autoclicker.py(yes, with sudo).