Skip to content

Instantly share code, notes, and snippets.

@cooliscool
Last active October 28, 2023 05:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cooliscool/17aa92fa1e606a977c043c5e2ecb3e6b to your computer and use it in GitHub Desktop.
Save cooliscool/17aa92fa1e606a977c043c5e2ecb3e6b to your computer and use it in GitHub Desktop.
Mouse Jerk 😜
import pyautogui
import random
import time
while True:
current_x, current_y = pyautogui.position()
# Generate random x and y coordinates around the current position
new_x = current_x + random.randint(-5, 5)
new_y = current_y + random.randint(-5, 5)
# Move the mouse to the new position
pyautogui.moveTo(new_x, new_y, duration=random.randint(0, 10)/10.0)
# Pause for a short duration before the next movement
time.sleep(random.randint(0, 10)/10.0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment