forked from SpielerNogard/geschenkebot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscreen_checker.py
More file actions
executable file
·67 lines (51 loc) · 1.8 KB
/
screen_checker.py
File metadata and controls
executable file
·67 lines (51 loc) · 1.8 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import subprocess
import time
from datetime import datetime
from watcher import watcher
from screen_maker import screen_maker
class screen_checker(object):
def __init__(self):
self.log("screen_checker ready")
self.screen_maker = screen_maker()
self.Watcher = watcher()
def log(self,info):
now = datetime.now().time()
now = str(now)
print(now+" : "+info)
def check_screen(self):
self.log("Checke Screen")
self.screen_maker.make_screen()
self.check_for_warning()
self.screen_maker.make_screen()
self.check_for_info()
self.screen_maker.make_screen()
def check_for_warning(self):
pos = self.Watcher.find_pos("ok")
name = pos[0]
coords = pos[1]
val = pos[2]
x = coords[0]
y = coords[1]
self.log("Suche nach Warnung")
if val >= 0.8:
subprocess.call("adb shell input tap "+str(x)+" "+str(y),shell=True)
time.sleep(10)
self.log("Warnung gefunden und geklickt")
else:
self.log("Konnte keine Warnung finden")
def check_for_info(self):
pos = self.Watcher.find_pos("ausblenden")
name = pos[0]
coords = pos[1]
val = pos[2]
x = coords[0]
y = coords[1]
self.log("Suche nach Informationen zum ausblenden")
if val >= 0.8:
subprocess.call("adb shell input tap "+str(x)+" "+str(y),shell=True)
time.sleep(10)
self.log("Informationen gefunden und geklickt")
else:
self.log("Konnte keine Informationen finden")
def chek_for_lvl_up(self):
pass