1
0
mirror of https://github.com/TheFunny/ArisuAutoSweeper synced 2025-12-16 11:15:13 +00:00

Compare commits

...

4 Commits

6 changed files with 22 additions and 12 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 28 KiB

View File

@ -31,9 +31,9 @@ AP_EXCEED = ButtonWrapper(
name='AP_EXCEED',
jp=Button(
file='./assets/jp/base/popup/AP_EXCEED.png',
area=(611, 147, 669, 177),
search=(591, 127, 689, 197),
color=(143, 156, 170),
area=(400, 288, 879, 377),
search=(380, 268, 899, 397),
color=(201, 202, 202),
button=(539, 470, 743, 533),
),
en=Button(
@ -133,9 +133,9 @@ INSUFFICIENT_INVENTORY = ButtonWrapper(
name='INSUFFICIENT_INVENTORY',
jp=Button(
file='./assets/jp/base/popup/INSUFFICIENT_INVENTORY.png',
area=(610, 124, 669, 153),
search=(590, 104, 689, 173),
color=(139, 153, 168),
area=(371, 392, 896, 451),
search=(351, 372, 916, 471),
color=(213, 218, 222),
button=(535, 494, 746, 565),
),
en=Button(

View File

@ -63,9 +63,10 @@ class Cafe(CafeUI):
self.click_with_interval(GET_REWARD)
case CafeStatus.GOT:
logger.info('Cafe reward have been got')
self.appear_then_click(GET_REWARD_CLOSE)
if not self.appear(GET_REWARD_CLOSE):
return CafeStatus.INVITATION
if self.appear(GET_REWARD_CLOSE):
self.click_with_interval(GET_REWARD_CLOSE, 1)
return status
return CafeStatus.INVITATION
case CafeStatus.INVITATION:
if handle_invitation(self):
return CafeStatus.CLICK
@ -77,6 +78,8 @@ class Cafe(CafeUI):
return CafeStatus.CHECK
self.click_with_interval(buttons[0], interval=1)
case CafeStatus.CHECK:
if self.appear_then_click(GET_REWARD_CLOSE):
return status
buttons = self.get_clickable_buttons()
if not self.is_adjust_on:
if not buttons:

View File

@ -41,8 +41,6 @@ class TacticalChallenge(TacticalChallengeUI):
def _handle_challenge(self, status):
match status:
case TCStatus.REWARD:
if self.ui_additional():
return status
if self.get_reward():
return TCStatus.OCR
case TCStatus.OCR:

View File

@ -26,17 +26,26 @@ class TacticalChallengeUI(UI):
def get_reward(self):
timer = Timer(10, 10).start()
action_timer = Timer(0.5, 1)
while 1:
self.device.screenshot()
self.ui_additional()
if not action_timer.reached_and_reset():
continue
if self.handle_insufficient_inventory():
logger.warning('Insufficient inventory, skip reward')
return True
if self.ui_additional():
continue
if self.match_color(GOT_REWARD_DAILY) and self.match_color(GOT_REWARD_CREDIT):
return True
if self.match_color(GET_REWARD_DAILY):
self.click_with_interval(GET_REWARD_DAILY, 0.3)
logger.info('Get daily reward')
continue
if self.match_color(GET_REWARD_CREDIT):
self.click_with_interval(GET_REWARD_CREDIT, 0.3)
logger.info('Get credit reward')
continue
if timer.reached():
return False