Skip to content

Commit 678aba2

Browse files
committed
Opt: use LoggerUnlock in storage
1 parent eb33bdd commit 678aba2

7 files changed

Lines changed: 16 additions & 0 deletions

File tree

1.09 KB
Loading
1.09 KB
Loading
1.09 KB
Loading
1.09 KB
Loading

module/os/tasks/voucher.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ def os_voucher(self):
2121
self._os_voucher_enter()
2222
VoucherShop(self.config, self.device).run()
2323
self._os_voucher_exit()
24+
self.logger_use()
2425

2526
next_reset = get_os_next_reset()
2627
logger.info('OS voucher finished, delay to next reset')

module/os_handler/assets.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
TEMPLATE_STORAGE_ABYSSAL = Template(file={'cn': './assets/cn/os_handler/TEMPLATE_STORAGE_ABYSSAL.png', 'en': './assets/en/os_handler/TEMPLATE_STORAGE_ABYSSAL.png', 'jp': './assets/jp/os_handler/TEMPLATE_STORAGE_ABYSSAL.png', 'tw': './assets/tw/os_handler/TEMPLATE_STORAGE_ABYSSAL.png'})
8181
TEMPLATE_STORAGE_COMBAT = Template(file={'cn': './assets/cn/os_handler/TEMPLATE_STORAGE_COMBAT.png', 'en': './assets/en/os_handler/TEMPLATE_STORAGE_COMBAT.png', 'jp': './assets/jp/os_handler/TEMPLATE_STORAGE_COMBAT.png', 'tw': './assets/tw/os_handler/TEMPLATE_STORAGE_COMBAT.png'})
8282
TEMPLATE_STORAGE_LOGGER = Template(file={'cn': './assets/cn/os_handler/TEMPLATE_STORAGE_LOGGER.gif', 'en': './assets/en/os_handler/TEMPLATE_STORAGE_LOGGER.gif', 'jp': './assets/jp/os_handler/TEMPLATE_STORAGE_LOGGER.gif', 'tw': './assets/tw/os_handler/TEMPLATE_STORAGE_LOGGER.gif'})
83+
TEMPLATE_STORAGE_LOGGER_UNLOCK = Template(file={'cn': './assets/cn/os_handler/TEMPLATE_STORAGE_LOGGER_UNLOCK.png', 'en': './assets/en/os_handler/TEMPLATE_STORAGE_LOGGER_UNLOCK.png', 'jp': './assets/jp/os_handler/TEMPLATE_STORAGE_LOGGER_UNLOCK.png', 'tw': './assets/tw/os_handler/TEMPLATE_STORAGE_LOGGER_UNLOCK.png'})
8384
TEMPLATE_STORAGE_OBSCURE = Template(file={'cn': './assets/cn/os_handler/TEMPLATE_STORAGE_OBSCURE.png', 'en': './assets/en/os_handler/TEMPLATE_STORAGE_OBSCURE.png', 'jp': './assets/jp/os_handler/TEMPLATE_STORAGE_OBSCURE.png', 'tw': './assets/tw/os_handler/TEMPLATE_STORAGE_OBSCURE.png'})
8485
TEMPLATE_STORAGE_OFFENSE = Template(file={'cn': './assets/cn/os_handler/TEMPLATE_STORAGE_OFFENSE.png', 'en': './assets/en/os_handler/TEMPLATE_STORAGE_OFFENSE.png', 'jp': './assets/jp/os_handler/TEMPLATE_STORAGE_OFFENSE.png', 'tw': './assets/tw/os_handler/TEMPLATE_STORAGE_OFFENSE.png'})
8586
TEMPLATE_STORAGE_QUALITY_COMBAT = Template(file={'cn': './assets/cn/os_handler/TEMPLATE_STORAGE_QUALITY_COMBAT.png', 'en': './assets/en/os_handler/TEMPLATE_STORAGE_QUALITY_COMBAT.png', 'jp': './assets/jp/os_handler/TEMPLATE_STORAGE_QUALITY_COMBAT.png', 'tw': './assets/tw/os_handler/TEMPLATE_STORAGE_QUALITY_COMBAT.png'})

module/os_handler/storage.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from module.os.globe_operation import GlobeOperation
88
from module.os.globe_zone import ZoneManager
99
from module.os_handler.assets import *
10+
from module.storage.assets import BOX_USE
1011
from module.ui.scroll import Scroll
1112

1213
SCROLL_STORAGE = Scroll(STORATE_SCROLL, color=(247, 211, 66))
@@ -80,6 +81,10 @@ def _storage_item_use(self, button):
8081
if self.appear_then_click(STORAGE_USE, offset=(180, 30), interval=5):
8182
self.interval_reset(STORAGE_CHECK)
8283
continue
84+
if self.appear_then_click(BOX_USE, offset=(180, 30), interval=5):
85+
self.interval_reset(STORAGE_CHECK)
86+
success = True
87+
continue
8388
if self.appear_then_click(GET_ITEMS_1, interval=5):
8489
self.interval_reset(STORAGE_CHECK)
8590
success = True
@@ -92,6 +97,8 @@ def _storage_item_use(self, button):
9297
self.device.click(CLICK_SAFE_AREA)
9398
success = True
9499
continue
100+
if self.handle_story_skip():
101+
continue
95102
# Use item
96103
if self.appear(STORAGE_CHECK, offset=(20, 20), interval=5):
97104
self.device.click(button)
@@ -114,6 +121,7 @@ def storage_logger_use_all(self):
114121

115122
image = rgb2gray(self.device.image)
116123
items = TEMPLATE_STORAGE_LOGGER.match_multi(image, similarity=0.5)
124+
items.extend(TEMPLATE_STORAGE_LOGGER_UNLOCK.match_multi(image, similarity=0.5))
117125
logger.attr('Storage_logger', len(items))
118126

119127
if len(items):
@@ -123,6 +131,12 @@ def storage_logger_use_all(self):
123131
logger.info('All loggers in storage have been used')
124132
break
125133

134+
def logger_use(self):
135+
logger.hr('Logger use')
136+
self.storage_enter()
137+
self.storage_logger_use_all()
138+
self.storage_quit()
139+
126140
def storage_sample_use_all(self):
127141
"""
128142
Pages:

0 commit comments

Comments
 (0)