Skip to content

Instantly share code, notes, and snippets.

@gridhead
Created July 17, 2021 17:02
Show Gist options
  • Select an option

  • Save gridhead/70aab52a25d2e089bb7aff8b9d67f6cc to your computer and use it in GitHub Desktop.

Select an option

Save gridhead/70aab52a25d2e089bb7aff8b9d67f6cc to your computer and use it in GitHub Desktop.
Reposition the cursor to new random location every after a random duration
from random import randint
from sys import exit
from time import sleep
#from pyautogui import moveTo, FAILSAFE
import pyautogui
pyautogui.FAILSAFE = False
if __name__ == "__main__":
print(" * Passive Mode")
while True:
try:
xpos, ypos, intr = randint(1, 1919), randint(1, 1079), randint(10, 60)
print(" * " + str(intr) + "s [" + str(xpos) + "," + str(ypos) + "]")
pyautogui.moveTo(xpos, ypos)
sleep(intr)
except KeyboardInterrupt:
print(" * Leaving passive mode...")
exit(0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment