Created
August 12, 2021 07:16
-
-
Save mylamour/84d9fddfd4de3ca2b9aa138f933be91b to your computer and use it in GitHub Desktop.
"Keep me online"
This file contains hidden or 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
import time | |
import random | |
import pyautogui | |
FLAG = True | |
OFFLINETIME = "18:00:00" | |
while True: | |
t = time.localtime() | |
current_time = time.strftime("%H:%M:%S", t) | |
if current_time == OFFLINETIME: | |
pyautogui.alert('下班了.') | |
break | |
if FLAG: | |
pyautogui.hotkey('ctrl','right') | |
FLAG = False | |
else: | |
pyautogui.hotkey('ctrl','left') | |
FLAG=True | |
pyautogui.PAUSE = random.randint(5, 10) # time.sleep(random.randint(10,80)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment