-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplayer.py
86 lines (67 loc) · 2.64 KB
/
player.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
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
from hsvfilter import HsvFilter
from webwalking import WebWalking
from windowcapture import Interactions, WindowCapture
from vision import Vision
from ocr import Ocr
class Player(Interactions, Vision):
def __init__(self) -> None:
super().__init__()
# self.run_boot = Interactions(area='run_boot')
# self.run_orb = WindowCapture(area='run_orb')
# self.health_orb = WindowCapture(area='health_orb')
# self.prayer_orb = WindowCapture(area='prayer_orb')
# self.special_orb = WindowCapture(area='special_orb')
# self.xp_bar = WindowCapture(area='xp_bar')
# self.stam_boot = Vision('Needle\\stam_boot.png')
self.vision = Vision('Needle\\banana.png')
self.filter = HsvFilter(vMin=136,sSub=255)
self.orbs = Ocr('samples/generalsamples.data', 'responses/generalresponses.data')
self.xpb = Ocr('samples/xpsamps.data', 'responses/xpresponses.data')
self.choose_option = Ocr('samples/bold12lowersamples.data', 'responses/bold12lowerresponses.data')
def health(self):
self.w = 42
self.h = 27
self.x = 1449
self.y = 166
im = self.apply_hsv_filter(self.get_screenshot(),self.filter)
health = self.orbs.number(im)
return health
def run(self):
self.w = 45
self.h = 29
self.x = 1470
self.y = 306
im = self.apply_hsv_filter(self.get_screenshot(),self.filter)
run = self.orbs.number(im)
return run
def prayer(self):
im = self.apply_hsv_filter(self.get_screenshot(),self.filter)
prayer = self.orbs.number(im)
return prayer
def stats(self):
im = self.apply_hsv_filter(self.get_screenshot(),self.filter)
health = self.numbers.number(im)
im = self.apply_hsv_filter(self.get_screenshot(),self.filter)
run = self.numbers.number(im)
im = self.apply_hsv_filter(self.get_screenshot(),self.filter)
prayer = self.numbers.number(im)
text = "health: " + str(health) + " run: " + str(run) + " prayer: " + str(prayer) + "."
return text
def xp(self):
self.w = 138
self.h = 47
self.x = 1265
self.y = 103
im = self.apply_hsv_filter(self.get_screenshot(),self.filter)
xp = self.xpb.text(im)
return xp
# def bank_number(self):
# im = self.vision.apply_hsv_filter(self.bank_num.get_screenshot(),self.filter)
# number = self.numbers.number(im)
# return number
def need_stam(self):
if self.run() > 65:
pass
else:
print("NEED STAM")
return True