mirror of
https://github.com/TheFunny/ArisuAutoSweeper
synced 2026-02-06 11:05:12 +00:00
Compare commits
No commits in common. "79ea59d60ca3e41c4d0a114066640244920270ce" and "bea794386cf02056c0630850187a4664be808f5f" have entirely different histories.
79ea59d60c
...
bea794386c
@ -133,14 +133,13 @@ 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):
|
|
||||||
self.click_with_interval(CHECK_REWARD, interval=6)
|
|
||||||
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.click_with_interval(GET_REWARD)
|
self.device.click(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)
|
||||||
@ -152,7 +151,7 @@ class Cafe(UI):
|
|||||||
logger.attr('Clickable', self.click)
|
logger.attr('Clickable', self.click)
|
||||||
if not buttons:
|
if not buttons:
|
||||||
return CafeStatus.CHECK
|
return CafeStatus.CHECK
|
||||||
self.click_with_interval(buttons[0], interval=1)
|
self.device.click(buttons[0])
|
||||||
case CafeStatus.CHECK:
|
case CafeStatus.CHECK:
|
||||||
buttons = self._get_clickable_buttons()
|
buttons = self._get_clickable_buttons()
|
||||||
if not self.is_adjust_on:
|
if not self.is_adjust_on:
|
||||||
@ -195,6 +194,7 @@ class Cafe(UI):
|
|||||||
status = CafeStatus.STUDENT_LIST
|
status = CafeStatus.STUDENT_LIST
|
||||||
loading_timer = Timer(2).start()
|
loading_timer = Timer(2).start()
|
||||||
action_timer = Timer(1.5, count=1) # cant be too fast
|
action_timer = Timer(1.5, count=1) # cant be too fast
|
||||||
|
check_timer = Timer(1, count=1)
|
||||||
is_list = False
|
is_list = False
|
||||||
is_reset = False
|
is_reset = False
|
||||||
is_second = False
|
is_second = False
|
||||||
@ -253,9 +253,12 @@ class Cafe(UI):
|
|||||||
is_reset = True
|
is_reset = True
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
if status == CafeStatus.CHECK and not check_timer.reached_and_reset():
|
||||||
|
continue
|
||||||
|
|
||||||
if action_timer.reached_and_reset():
|
if action_timer.reached_and_reset():
|
||||||
logger.attr('Status', status)
|
|
||||||
status = self._handle_cafe(status)
|
status = self._handle_cafe(status)
|
||||||
|
logger.attr('Status', status)
|
||||||
|
|
||||||
if not is_second_cafe_on:
|
if not is_second_cafe_on:
|
||||||
if status is CafeStatus.FINISHED:
|
if status is CafeStatus.FINISHED:
|
||||||
|
|||||||
@ -47,8 +47,8 @@ class Circle(UI):
|
|||||||
status = CircleStatus.GOT
|
status = CircleStatus.GOT
|
||||||
|
|
||||||
if action_timer.reached_and_reset():
|
if action_timer.reached_and_reset():
|
||||||
logger.attr('Status', status)
|
|
||||||
status = self._handle_circle(status)
|
status = self._handle_circle(status)
|
||||||
|
logger.attr('Status', status)
|
||||||
|
|
||||||
if status is CircleStatus.FINISHED:
|
if status is CircleStatus.FINISHED:
|
||||||
break
|
break
|
||||||
|
|||||||
@ -146,8 +146,8 @@ class TacticalChallenge(UI):
|
|||||||
if not ui_timer.reached():
|
if not ui_timer.reached():
|
||||||
continue
|
continue
|
||||||
if action_timer.reached_and_reset():
|
if action_timer.reached_and_reset():
|
||||||
logger.attr('Status', status.name)
|
|
||||||
status = self._handle_challenge(status)
|
status = self._handle_challenge(status)
|
||||||
|
logger.attr('Status', status.name)
|
||||||
if status in (TCStatus.FINAL, TCStatus.FINISHED):
|
if status in (TCStatus.FINAL, TCStatus.FINISHED):
|
||||||
break
|
break
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user