Created
October 10, 2023 15:09
-
-
Save toloco/90f9b24b7ac2d68856d3980f5acebc94 to your computer and use it in GitHub Desktop.
move on move on
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
#!/usr/bin/env python3 | |
import argparse | |
import math | |
import time | |
from datetime import datetime | |
import pyautogui | |
pyautogui.FAILSAFE = False | |
SCREEN_SIZE = pyautogui.size() | |
def parse_args(): | |
parser = argparse.ArgumentParser() | |
parser.add_argument( | |
"--timer", | |
type=int, | |
default=0, | |
help="Timer (in minutes), 0 means forever", | |
) | |
parser.add_argument( | |
"--length", | |
type=int, | |
default=10, | |
# choices=range(10, 1000), | |
metavar="[10-1000]", | |
help="Lenght of movement (in secs)", | |
) | |
parser.add_argument( | |
"--wait", | |
type=int, | |
default=10, | |
# choices=range(10, 1000), | |
metavar="[10-1000]", | |
help="Waiting time between movements (in secs)", | |
) | |
parser.set_defaults(feature=True) | |
return parser.parse_args() | |
def nod(length=int): | |
pos = pyautogui.position() | |
x = ((pos.x * 177) % (SCREEN_SIZE[0] * 0.8)) + SCREEN_SIZE[0] * 0.1 | |
y = math.pow(pos.y, 21) % (SCREEN_SIZE[1] * 0.8) + SCREEN_SIZE[1] * 0.1 | |
pyautogui.moveTo(x, y, length, pyautogui.easeInOutQuad) | |
print(f"{datetime.now().time()} ping") | |
# pyautogui.press("winright") | |
if __name__ == "__main__": | |
args = parse_args() | |
counter = 0 | |
while True: | |
if args.timer > 0 and (args.timer * 60) < ((args.wait + args.length) * counter): | |
print(f"{datetime.now().time()} Bye!") | |
exit(0) | |
time.sleep(args.wait) | |
nod(args.length) | |
counter += 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment