Skip to content

Commit 4259c29

Browse files
committed
fix(api): fix event bounties and improve perf
1 parent 0ca7f24 commit 4259c29

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

api/autoafk/activities.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -160,14 +160,16 @@ def dispatch_bounties(settings: DispatchBountiesSettings) -> None:
160160
touch_img_when_visible("buttons/dispatch")
161161
touch_img_when_visible("buttons/confirm")
162162

163-
# TODO::imgs-untested
164-
if settings["event_bounties"]:
165-
if touch_img_wait("labels/event_bounty"):
166-
touch_img_wait("buttons/collect_all", seconds=2)
167-
while touch_img_wait("buttons/dispatch_bounties"):
168-
touch_xy_wait(530, 1030, seconds=2)
169-
touch_xy_wait(120, 1500)
170-
touch_img_wait("buttons/dispatch", confidence=0.8, grayscale=True)
163+
if settings["event_bounties"] and touch_img_when_visible(
164+
"labels/event_bounty", timeout_s=0.1
165+
):
166+
touch_img_when_visible("buttons/collect_all", timeout_s=1)
167+
while touch_img_when_visible_after_wait(
168+
"buttons/dispatch_bounties", timeout_s=1, seconds=0.1
169+
):
170+
touch_xy_after_wait(530, 1030, seconds=0.25)
171+
touch_xy_after_wait(120, 1500, seconds=0.25)
172+
touch_img_when_visible("buttons/dispatch")
171173

172174
logger.info("Bounties dispatched")
173175

api/autoafk/img/labels/event_bounty.png

100644100755
-4.73 KB
Loading

api/test/ss-imgs-map.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
"dark-forest/bounty-board/solo-dispatch": ["buttons/dispatch"],
5555
"dark-forest/bounty-board/team-collect": ["buttons/collect_all"],
5656
"dark-forest/bounty-board/team": ["buttons/dispatch", "buttons/back"],
57+
"dark-forest/bounty-board/team-with-event": ["labels/event_bounty"],
5758
"dark-forest/bounty-board/team-dispatch": ["buttons/confirm"],
5859
"dark-forest/roamer": ["buttons/exitmenu"],
5960
"dark-forest/towers/kings-tower": ["buttons/back"],
818 KB
Loading

0 commit comments

Comments
 (0)