mirror of
https://github.com/TheFunny/ArisuAutoSweeper
synced 2025-12-16 19:55:12 +00:00
perf(popup): improve reward handle stability
This commit is contained in:
parent
0551207714
commit
61fa6ad28b
@ -27,7 +27,7 @@ class PopupHandler(ModuleBase):
|
|||||||
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def handle_reward(self, interval=5) -> bool:
|
def handle_reward(self) -> bool:
|
||||||
"""
|
"""
|
||||||
Args:
|
Args:
|
||||||
interval:
|
interval:
|
||||||
@ -35,15 +35,13 @@ class PopupHandler(ModuleBase):
|
|||||||
Returns:
|
Returns:
|
||||||
If handled.
|
If handled.
|
||||||
"""
|
"""
|
||||||
if self.appear_then_click(GET_REWARD, interval=interval):
|
if self.appear(GET_REWARD) or self.match_color(GET_REWARD, threshold=30):
|
||||||
timer = Timer(0.2).start()
|
|
||||||
while 1:
|
while 1:
|
||||||
if timer.reached_and_reset():
|
self.device.screenshot()
|
||||||
self.device.screenshot()
|
if self.appear(GET_REWARD) or self.match_color(GET_REWARD, threshold=30):
|
||||||
if self.appear(GET_REWARD):
|
self.click_with_interval(GET_REWARD, interval=0.5)
|
||||||
self.device.click(GET_REWARD)
|
else:
|
||||||
else:
|
break
|
||||||
break
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user