Skip to content
This repository has been archived by the owner on Oct 18, 2024. It is now read-only.

Commit

Permalink
improve align engine output solve
Browse files Browse the repository at this point in the history
  • Loading branch information
TimShaw1 committed Jun 26, 2023
1 parent 06006ec commit 986c403
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions task-solvers/Align Engine Output.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,20 @@
dimensions[2] = round(dimensions[2])
y_center = ((dimensions[1] + round(dimensions[1] / 1.2) + dimensions[3]) / 2)

arrow_pos = None
arrow_names = ["Arrow", "arrowDown", "arrowUp"]
# Color is 88 88 95

for name in arrow_names:
arrow_pos = pyautogui.locateCenterOnScreen(f"{get_dir()}\\task-solvers\\cv2-templates\\Align Engine Output\\{name}.png", confidence=0.37, region=dimensions)
if arrow_pos:
break
while not is_task_done("Align Engine Output"):
screenshot = get_screenshot(dimensions)
exit = False

pyautogui.moveTo(arrow_pos[0] + 5, arrow_pos[1])
pyautogui.dragTo(arrow_pos[0], y_center, duration=0.3, tween=pyautogui.easeOutQuad)
if is_urgent_task():
click_close()
raise SystemExit(0)

for x in range(screenshot.width):
for y in range(screenshot.height):
pixel = screenshot.getpixel((x, y))
if pixel[1] < 90 and pixel[1] > 86 and pixel[0] < 90 and pixel[0] > 86 and pixel[2] < 100 and pixel[2] > 90:
pyautogui.moveTo(dimensions[0] + x, dimensions[1] + y)
pyautogui.dragTo(dimensions[0] + x, y_center, abs((dimensions[1] + y) - y_center) / 400)
raise SystemExit(0)
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 986c403

Please sign in to comment.