-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbank_skills.py
82 lines (63 loc) · 2.22 KB
/
bank_skills.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
from windowcapture import InventoryRegion, ScreenRegion
import time
import random
from numpy import array
from vision import Vision
'''
west GE
full zoom
withdraw set to x (14)
everything in own tab
'''
screen = ScreenRegion()
inventory = InventoryRegion()
bank = Vision('Needle\\bank_skills\\compost\\ge_bank.png')
x = Vision('Needle\\bank_skills\\compost\\x.png')
deposit = Vision('Needle\\bank_skills\\compost\\deposit.png')
compost = Vision('Needle\\bank_skills\\compost\\compost.png')
saltpetre = Vision('Needle\\bank_skills\\compost\\saltpetre.png')
headless = Vision('Needle\\bank_skills\\fletching\\headless.png')
steel_tip = Vision('Needle\\bank_skills\\fletching\\steel_tip.png')
make_region = array([(485,122,199,143)])
def run_timer():
current_time = (time.time() - start_time)
current_time_format = time.strftime("%H:%M:%S", time.gmtime(current_time))
print(f"run time: {current_time_format}")
def saltpetre_compost():
while screen.contains(x) == False:
if screen.contains(bank, threshold=0.75):
screen.click(bank, threshold=0.75)
time.sleep(0.7)
screen.click(deposit)
time.sleep(random.normalvariate(0.64, 0.004))
else:
screen.wait_for(bank, threshold=0.75)
time.sleep(0.44)
screen.click(compost,1)
time.sleep(random.normalvariate(0.31, 0.002))
screen.click(saltpetre,1)
time.sleep(random.normalvariate(0.44, 0.004))
screen.click(x)
time.sleep(random.normalvariate(.5, 0.03))
print('making compost...')
inventory.click(compost, ind=-1)
time.sleep(random.normalvariate(0.32, 0.004))
inventory.click(saltpetre)
time.sleep(random.normalvariate(33, 0.24))
screen.click(bank, threshold=0.75)
time.sleep(0.9)
screen.click(deposit)
inventory.wait_for(compost) == False
time.sleep(0.62)
def arrow_tip(arrow_tip):
inventory.click(headless, threshold=0.85)
time.sleep(random.uniform(0.384, 0.47))
inventory.click(arrow_tip, threshold=0.85)
time.sleep(random.uniform(0.79, 0.91))
screen.click_region(make_region)
time.sleep(12.9)
start_time = time.time()
print('starting script...')
while True:
saltpetre_compost()
run_timer()