-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.py
35 lines (23 loc) · 859 Bytes
/
main.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
33
34
35
import pyautogui
from time import sleep
from sms import SMS
import config
def check_screen():
try:
return pyautogui.locateOnScreen('gamefound.png', grayscale=True, confidence=.5)
except Exception as e:
print(f'check_screen error: {e}')
def main(continuous_mode):
print("\n\nOverwatch Notification is now running...")
sms = SMS(config.number, config.carrier, config.email, config.password)
while True:
game_found = check_screen()
if game_found:
print("\nOverwatch game starting detected...")
sms.send("Your Overwatch game is starting!")
print("Notification has been sent to your phone.")
if not continuous_mode:
return print("Overwatch Notification has terminated.")
sleep(10)
if __name__ == '__main__':
main(False)