-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkeep-alive.py
executable file
·32 lines (28 loc) · 996 Bytes
/
keep-alive.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/python3 -u
import os
import time
import random
import pyautogui
from dotenv import load_dotenv
from python_imagesearch.imagesearch import imagesearch
load_dotenv()
while 1:
pos = imagesearch("./login.png")
if pos[0] != -1:
print("login")
pyautogui.moveTo(410, 350, 2, pyautogui.easeOutQuad)
pyautogui.click()
time.sleep(1)
pyautogui.write(os.getenv('password'))#, interval = 0.1)
pyautogui.hotkey('enter')
pyautogui.moveTo(420, 380, 1, pyautogui.easeOutQuad)
time.sleep(20)
pyautogui.click()
else:
intv1 = random.randrange(60, 120, 1)
time.sleep(intv1)
intv2 = random.randrange(60, 120, 1)
time.sleep(intv2)
#pyautogui.moveTo(random.randrange(1100, 1130, 1), random.randrange(1005, 1055, 1), 2, pyautogui.easeOutQuad)
pyautogui.moveTo(random.randrange(540, 565, 1), random.randrange(530, 560, 1), 2, pyautogui.easeOutQuad)
pyautogui.click()