mirror of
https://github.com/TheFunny/ArisuAutoSweeper
synced 2025-12-16 22:05:12 +00:00
Compare commits
4 Commits
8fe8ed5f86
...
34af75245e
| Author | SHA1 | Date | |
|---|---|---|---|
| 34af75245e | |||
| 6e3d5fc4c5 | |||
| 16d5f214d8 | |||
| f669130e33 |
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 |
@ -31,9 +31,9 @@ AP_EXCEED = ButtonWrapper(
|
|||||||
name='AP_EXCEED',
|
name='AP_EXCEED',
|
||||||
jp=Button(
|
jp=Button(
|
||||||
file='./assets/jp/base/popup/AP_EXCEED.png',
|
file='./assets/jp/base/popup/AP_EXCEED.png',
|
||||||
area=(611, 147, 669, 177),
|
area=(400, 288, 879, 377),
|
||||||
search=(591, 127, 689, 197),
|
search=(380, 268, 899, 397),
|
||||||
color=(143, 156, 170),
|
color=(201, 202, 202),
|
||||||
button=(539, 470, 743, 533),
|
button=(539, 470, 743, 533),
|
||||||
),
|
),
|
||||||
en=Button(
|
en=Button(
|
||||||
@ -133,9 +133,9 @@ INSUFFICIENT_INVENTORY = ButtonWrapper(
|
|||||||
name='INSUFFICIENT_INVENTORY',
|
name='INSUFFICIENT_INVENTORY',
|
||||||
jp=Button(
|
jp=Button(
|
||||||
file='./assets/jp/base/popup/INSUFFICIENT_INVENTORY.png',
|
file='./assets/jp/base/popup/INSUFFICIENT_INVENTORY.png',
|
||||||
area=(610, 124, 669, 153),
|
area=(371, 392, 896, 451),
|
||||||
search=(590, 104, 689, 173),
|
search=(351, 372, 916, 471),
|
||||||
color=(139, 153, 168),
|
color=(213, 218, 222),
|
||||||
button=(535, 494, 746, 565),
|
button=(535, 494, 746, 565),
|
||||||
),
|
),
|
||||||
en=Button(
|
en=Button(
|
||||||
|
|||||||
@ -63,9 +63,10 @@ class Cafe(CafeUI):
|
|||||||
self.click_with_interval(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)
|
if self.appear(GET_REWARD_CLOSE):
|
||||||
if not self.appear(GET_REWARD_CLOSE):
|
self.click_with_interval(GET_REWARD_CLOSE, 1)
|
||||||
return CafeStatus.INVITATION
|
return status
|
||||||
|
return CafeStatus.INVITATION
|
||||||
case CafeStatus.INVITATION:
|
case CafeStatus.INVITATION:
|
||||||
if handle_invitation(self):
|
if handle_invitation(self):
|
||||||
return CafeStatus.CLICK
|
return CafeStatus.CLICK
|
||||||
@ -77,6 +78,8 @@ class Cafe(CafeUI):
|
|||||||
return CafeStatus.CHECK
|
return CafeStatus.CHECK
|
||||||
self.click_with_interval(buttons[0], interval=1)
|
self.click_with_interval(buttons[0], interval=1)
|
||||||
case CafeStatus.CHECK:
|
case CafeStatus.CHECK:
|
||||||
|
if self.appear_then_click(GET_REWARD_CLOSE):
|
||||||
|
return status
|
||||||
buttons = self.get_clickable_buttons()
|
buttons = self.get_clickable_buttons()
|
||||||
if not self.is_adjust_on:
|
if not self.is_adjust_on:
|
||||||
if not buttons:
|
if not buttons:
|
||||||
|
|||||||
@ -41,8 +41,6 @@ class TacticalChallenge(TacticalChallengeUI):
|
|||||||
def _handle_challenge(self, status):
|
def _handle_challenge(self, status):
|
||||||
match status:
|
match status:
|
||||||
case TCStatus.REWARD:
|
case TCStatus.REWARD:
|
||||||
if self.ui_additional():
|
|
||||||
return status
|
|
||||||
if self.get_reward():
|
if self.get_reward():
|
||||||
return TCStatus.OCR
|
return TCStatus.OCR
|
||||||
case TCStatus.OCR:
|
case TCStatus.OCR:
|
||||||
|
|||||||
@ -26,17 +26,26 @@ class TacticalChallengeUI(UI):
|
|||||||
|
|
||||||
def get_reward(self):
|
def get_reward(self):
|
||||||
timer = Timer(10, 10).start()
|
timer = Timer(10, 10).start()
|
||||||
|
action_timer = Timer(0.5, 1)
|
||||||
while 1:
|
while 1:
|
||||||
self.device.screenshot()
|
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):
|
if self.match_color(GOT_REWARD_DAILY) and self.match_color(GOT_REWARD_CREDIT):
|
||||||
return True
|
return True
|
||||||
if self.match_color(GET_REWARD_DAILY):
|
if self.match_color(GET_REWARD_DAILY):
|
||||||
self.click_with_interval(GET_REWARD_DAILY, 0.3)
|
self.click_with_interval(GET_REWARD_DAILY, 0.3)
|
||||||
logger.info('Get daily reward')
|
logger.info('Get daily reward')
|
||||||
|
continue
|
||||||
if self.match_color(GET_REWARD_CREDIT):
|
if self.match_color(GET_REWARD_CREDIT):
|
||||||
self.click_with_interval(GET_REWARD_CREDIT, 0.3)
|
self.click_with_interval(GET_REWARD_CREDIT, 0.3)
|
||||||
logger.info('Get credit reward')
|
logger.info('Get credit reward')
|
||||||
|
continue
|
||||||
if timer.reached():
|
if timer.reached():
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user