Skip to content

Commit

Permalink
fix(api): fix event bounties and improve perf
Browse files Browse the repository at this point in the history
  • Loading branch information
aentwist committed Aug 1, 2024
1 parent 0ca7f24 commit 4259c29
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
18 changes: 10 additions & 8 deletions api/autoafk/activities.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,14 +160,16 @@ def dispatch_bounties(settings: DispatchBountiesSettings) -> None:
touch_img_when_visible("buttons/dispatch")
touch_img_when_visible("buttons/confirm")

# TODO::imgs-untested
if settings["event_bounties"]:
if touch_img_wait("labels/event_bounty"):
touch_img_wait("buttons/collect_all", seconds=2)
while touch_img_wait("buttons/dispatch_bounties"):
touch_xy_wait(530, 1030, seconds=2)
touch_xy_wait(120, 1500)
touch_img_wait("buttons/dispatch", confidence=0.8, grayscale=True)
if settings["event_bounties"] and touch_img_when_visible(
"labels/event_bounty", timeout_s=0.1
):
touch_img_when_visible("buttons/collect_all", timeout_s=1)
while touch_img_when_visible_after_wait(
"buttons/dispatch_bounties", timeout_s=1, seconds=0.1
):
touch_xy_after_wait(530, 1030, seconds=0.25)
touch_xy_after_wait(120, 1500, seconds=0.25)
touch_img_when_visible("buttons/dispatch")

logger.info("Bounties dispatched")

Expand Down
Binary file modified api/autoafk/img/labels/event_bounty.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions api/test/ss-imgs-map.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"dark-forest/bounty-board/solo-dispatch": ["buttons/dispatch"],
"dark-forest/bounty-board/team-collect": ["buttons/collect_all"],
"dark-forest/bounty-board/team": ["buttons/dispatch", "buttons/back"],
"dark-forest/bounty-board/team-with-event": ["labels/event_bounty"],
"dark-forest/bounty-board/team-dispatch": ["buttons/confirm"],
"dark-forest/roamer": ["buttons/exitmenu"],
"dark-forest/towers/kings-tower": ["buttons/back"],
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 4259c29

Please sign in to comment.