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

Commit

Permalink
implement async inspect sample
Browse files Browse the repository at this point in the history
  • Loading branch information
TimShaw1 committed Jun 26, 2023
1 parent 986c403 commit 606907f
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion last_area.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Cafeteria
Admin
2 changes: 1 addition & 1 deletion last_task.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nothing. No tasks completed yet
Upload Data in Admin
5 changes: 5 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,11 @@ def move_and_complete_tasks(G, move_list, tasks):
move_list = sort_shortest_path(G, nearest, move_list, tasks)
if tsk[0] == "Reset Reactor" or tsk[0] == "Restore Oxygen":
move_list.pop(0)
if tsk[0] == "Inspect Sample" and return_code == 2:
temp = move_list[0]
move_list.pop(0)
move_list.append(temp)

continue

# If we're done all out tasks
Expand Down
2 changes: 1 addition & 1 deletion solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def solve_task(task_name=None, task_location=None) -> int:
return 1 if task_name != "Inspect Sample" else 2
time.sleep(1/30)

return 0
return 2 if task_name == "Inspect Sample" else 0

print("Task not found")
return -1
Expand Down
8 changes: 5 additions & 3 deletions task-solvers/Inspect Sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,16 @@
y = dimensions[1] + round(dimensions[3] / 1.16)
pyautogui.click((x,y))

# Bruh
time.sleep(61)
click_close()
raise SystemExit(0)

"""
y_offset = dimensions[3]
dimensions[0] += round(dimensions[2] / 2.81)
dimensions[1] += round(dimensions[3] / 3.2)
dimensions[2] = round(dimensions[2] / 3.4)
dimensions[3] = round(dimensions[3] / 3.6)
pos = pyautogui.locateCenterOnScreen(f"{get_dir()}\\task-solvers\\cv2-templates\\Inspect Sample\\anomaly.png", confidence=0.5, region=dimensions)
pyautogui.click(pos[0], pos[1] + round(y_offset / 2.87))
pyautogui.click(pos[0], pos[1] + round(y_offset / 2.87))
"""

0 comments on commit 606907f

Please sign in to comment.