mirror of
https://github.com/LmeSzinc/StarRailCopilot.git
synced 2024-11-16 06:25:24 +00:00
Fix: Salvage relic timeout & check_all assignment
This commit is contained in:
parent
b264fd5f3c
commit
5d55f86b27
@ -133,6 +133,7 @@ class Assignment(AssignmentClaim, SynthesizeUI):
|
||||
"""
|
||||
logger.hr('Assignment check all', level=1)
|
||||
current, remain, _ = self._limit_status
|
||||
# current = #Claimable + #Dispatched
|
||||
if current == len(self.dispatched):
|
||||
return remain
|
||||
for group in self._iter_groups():
|
||||
@ -150,13 +151,15 @@ class Assignment(AssignmentClaim, SynthesizeUI):
|
||||
current -= 1
|
||||
remain += 1
|
||||
insight = True # Order of entries change after claiming
|
||||
if current == len(self.dispatched):
|
||||
return remain
|
||||
continue
|
||||
if status == AssignmentStatus.DISPATCHED:
|
||||
self.dispatched[assignment] = datetime.now() + \
|
||||
self._get_assignment_time()
|
||||
insight = False # Order of entries does not change here
|
||||
if current == len(self.dispatched):
|
||||
return remain
|
||||
insight = False # Order of entries does not change here
|
||||
continue
|
||||
break
|
||||
return remain
|
||||
|
@ -28,16 +28,20 @@ class RelicsUI(ItemUI):
|
||||
|
||||
skip_first_screenshot = True
|
||||
interval = Timer(1)
|
||||
timeout = Timer(5, count=3).start()
|
||||
while 1: # salvage -> first relic selected
|
||||
if skip_first_screenshot:
|
||||
skip_first_screenshot = False
|
||||
else:
|
||||
self.device.screenshot()
|
||||
|
||||
if timeout.reached():
|
||||
logger.warning('Timeout when selecting first relic')
|
||||
return False
|
||||
# The first frame entering relic page, SALVAGE is a white button as it's the default state.
|
||||
# At the second frame, SALVAGE is disabled since no items are selected.
|
||||
# So here uses the minus button on the first relic.
|
||||
if self.image_color_count(FIRST_RELIC_SELECTED, color=(245, 245, 245), threshold=221, count=50):
|
||||
if self.image_color_count(FIRST_RELIC_SELECTED, color=(245, 245, 245), threshold=221, count=300):
|
||||
logger.info('First relic selected')
|
||||
break
|
||||
if self.appear_then_click(ORDER_DESCENDING, interval=2):
|
||||
|
Loading…
Reference in New Issue
Block a user