-
Notifications
You must be signed in to change notification settings - Fork 2
/
bilge_pumping.py
48 lines (42 loc) · 1.33 KB
/
bilge_pumping.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
import pyautogui
from repair_mini_game import *
import time
class BilgePumping(RepairMiniGame):
def __init__(self):
super().__init__()
self.name = "bilge_pumping"
self.desired = "top"
self.iterations = 0
self.completed = False
self.button = Point(x=634, y=914)
def play(self):
top_strike_point = (682, 424)
bot_strike_point = (680, 650)
neutral_point = (982, 570)
p1 = None
p2 = None
while self.iterations <= 15:
if p1 is None:
p1 = pixel(top_strike_point)
if p2 is None:
p2 = pixel(bot_strike_point)
if p1[1] > p2[1]:
while p1 == pixel(top_strike_point):
pass
else:
pyautogui.click(neutral_point)
p1 = (0, 0, 0)
p2 = pixel(bot_strike_point)
self.iterations += 1
else:
while p2 == pixel(bot_strike_point):
pass
else:
pyautogui.click(neutral_point)
p2 = (0, 0, 0)
p1 = pixel(top_strike_point)
self.iterations += 1
self.completed = True
if __name__ == "__main__":
test = BilgePumping()
test.play()