Created
July 30, 2023 22:42
-
-
Save deitry/0ce5e9dd50c5e4d8e5aa16327fa123f3 to your computer and use it in GitHub Desktop.
Simple script to simulate spacebar key pressing
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
"""Simulate space press once in random time between 1 and 120 seconds to prevent the computer from sleeping.""" | |
import random | |
import pyautogui | |
while True: | |
# get a random int between 1 and 120 | |
# delay = 10 | |
delay = random.randint(1, 120) | |
pyautogui.sleep(delay) | |
pyautogui.press('space') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment