Created
April 3, 2020 23:38
-
-
Save MarkMichon1/8fa420af5834e9861298ca8bca19194e to your computer and use it in GitHub Desktop.
Anti AFK Script
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
from pynput.keyboard import Controller | |
import random | |
import time | |
key_press_dict = { | |
0 : 'w', | |
1 : 'a', | |
2 : 's', | |
3 : 'd' | |
} | |
# Virtual keyboard initialization | |
keyboard = Controller() | |
while True: # Loop until time depletes | |
random_key_press = key_press_dict[random.randint(0,3)] | |
print(random_key_press) | |
keyboard.press(random_key_press) | |
time.sleep(random.uniform(.18, .5)) | |
keyboard.release(random_key_press) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ty