1
0
mirror of https://github.com/TheFunny/ArisuAutoSweeper synced 2025-12-16 22:05:12 +00:00

perf: improve cafe reward stability

This commit is contained in:
YoursFunny 2023-11-03 22:39:23 +08:00
parent d53e280bfc
commit a20411071c
Signed by: YoursFunny
GPG Key ID: 207EDC3CD5B40F9C

View File

@ -133,13 +133,14 @@ class Cafe(UI):
if self.appear_then_click(CHECK_REWARD): if self.appear_then_click(CHECK_REWARD):
return CafeStatus.REWARD return CafeStatus.REWARD
case CafeStatus.REWARD: case CafeStatus.REWARD:
if not self.appear(GET_REWARD_CLOSE):
self.click_with_interval(CHECK_REWARD)
return status
if self.match_color(GOT_REWARD): if self.match_color(GOT_REWARD):
self.device.click(GET_REWARD_CLOSE) self.device.click(GET_REWARD_CLOSE)
return CafeStatus.GOT return CafeStatus.GOT
if not self.appear(GET_REWARD):
return CafeStatus.OCR
if self.match_color(GET_REWARD): if self.match_color(GET_REWARD):
self.device.click(GET_REWARD) self.click_with_interval(GET_REWARD)
case CafeStatus.GOT: case CafeStatus.GOT:
logger.info('Cafe reward have been got') logger.info('Cafe reward have been got')
self.appear_then_click(GET_REWARD_CLOSE) self.appear_then_click(GET_REWARD_CLOSE)