Created
September 22, 2022 09:09
-
-
Save ranelpadon/c2f6f37cdb809e64b4594deb4a8af104 to your computer and use it in GitHub Desktop.
Simple script to move the mouse cursor randomly and indefinitely. This will make your status stay "Online" in various apps.
This file contains 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
""" | |
Requires `pip install pyautogui`. | |
""" | |
import pyautogui | |
import random | |
import time | |
# Get the screen boundaries. | |
screen_width, screen_height = pyautogui.size() | |
print('Screen width: {}'.format(screen_width)) | |
print('Screen height: {}'.format(screen_height)) | |
# Run forever unless terminated. | |
while True: | |
# Move the mouse cursor to a new, random location within the screen. | |
new_x = random.randrange(screen_width) | |
new_y = random.randrange(screen_height) | |
print('Moving cursor to ({}, {})'.format(new_x, new_y)) | |
pyautogui.moveTo(new_x, new_y) | |
# Wait 60 seconds before moving the cursor again. | |
time.sleep(60) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment