update farm for 4.0

This commit is contained in:
Thaloria@web.de
2023-05-05 19:17:40 +02:00
parent c7deaaf6c7
commit a9e25527f5
3 changed files with 22 additions and 17 deletions

View File

@@ -104,10 +104,12 @@ class GameBase:
def assess_playfield_and_make_move(self):
pass
#screenshot = screenshot[190:1230, 260:2090]
#[58: 1134, 230: 2113]
def fill_data_coordinates(self):
# 230 to 2110 = 1883 / 14 = 134.5
# 60 to 1130 = 1076 / 8 = 134.5
dim = 134.5
# 260 to 2090 = 1883 / 14 = 130
# 190 to 1230 = 1076 / 8 = 130
dim = 130
for e in range(0, 8, 1):
for i in range(0, 14, 1):
self.data_coordinates[e][i] = [i * dim, e * dim, dim, dim]
@@ -121,8 +123,8 @@ class GameBase:
return True
def check_for_next_level(self, screen, needle):
offset_left = 230
offset_down = 58
offset_left = 260
offset_down = 190
rectangles = self.vision_stun.find(screen, needle, 0.70, 1)
if len(rectangles) == 0:
return False
@@ -218,8 +220,8 @@ class GameBase:
return int(center_x), int(center_y)
def move_tile(self, point_source, point_dest):
offset_left = 230
offset_down = 58
offset_left = 260
offset_down = 190
pydirectinput.moveTo(point_source[0] + offset_left, point_source[1] + offset_down)
# pydirectinput.moveTo(0,0)
pydirectinput.mouseDown()