mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-28 06:39:43 +08:00
Merge branch 'master' of https://github.com/LmeSzinc/AzurLaneAutoScript
This commit is contained in:
@@ -250,6 +250,8 @@ Coalition:
|
|||||||
FailureInterval: 30
|
FailureInterval: 30
|
||||||
ServerUpdate: 00:00
|
ServerUpdate: 00:00
|
||||||
Campaign:
|
Campaign:
|
||||||
|
Event:
|
||||||
|
type: state
|
||||||
Name: dynamic
|
Name: dynamic
|
||||||
Event:
|
Event:
|
||||||
type: state
|
type: state
|
||||||
|
|||||||
@@ -486,6 +486,8 @@ class ConfigGenerator:
|
|||||||
latest[server] = deep_get(self.args, keys=f'{task}.Campaign.Event.option_{server}', default=[])
|
latest[server] = deep_get(self.args, keys=f'{task}.Campaign.Event.option_{server}', default=[])
|
||||||
options = set().union(*latest.values())
|
options = set().union(*latest.values())
|
||||||
options = sorted([option for option in options if option != 'campaign_main'])
|
options = sorted([option for option in options if option != 'campaign_main'])
|
||||||
|
if task not in WAR_ARCHIVES:
|
||||||
|
deep_set(self.args, keys=f'{task}.Campaign.Event.option_bold', value=options)
|
||||||
deep_set(self.args, keys=f'{task}.Campaign.Event.option', value=options)
|
deep_set(self.args, keys=f'{task}.Campaign.Event.option', value=options)
|
||||||
deep_set(self.args, keys=f'{task}.Campaign.Event.option_bold', value=options)
|
deep_set(self.args, keys=f'{task}.Campaign.Event.option_bold', value=options)
|
||||||
|
|
||||||
|
|||||||
@@ -143,14 +143,14 @@ class Digit(Ocr):
|
|||||||
Method ocr() returns int, or a list of int.
|
Method ocr() returns int, or a list of int.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, buttons, lang='azur_lane', letter=(255, 255, 255), threshold=128, alphabet='0123456789IDSB',
|
def __init__(self, buttons, lang='azur_lane', letter=(255, 255, 255), threshold=128, alphabet='0123456789IDSBL',
|
||||||
name=None):
|
name=None):
|
||||||
super().__init__(buttons, lang=lang, letter=letter, threshold=threshold, alphabet=alphabet, name=name)
|
super().__init__(buttons, lang=lang, letter=letter, threshold=threshold, alphabet=alphabet, name=name)
|
||||||
|
|
||||||
def after_process(self, result):
|
def after_process(self, result):
|
||||||
result = super().after_process(result)
|
result = super().after_process(result)
|
||||||
result = result.replace('I', '1').replace('D', '0').replace('S', '5')
|
result = result.replace('I', '1').replace('D', '0').replace('S', '5')
|
||||||
result = result.replace('B', '8')
|
result = result.replace('B', '8').replace('L', '1')
|
||||||
|
|
||||||
prev = result
|
prev = result
|
||||||
result = int(result) if result else 0
|
result = int(result) if result else 0
|
||||||
@@ -166,14 +166,14 @@ class DigitYuv(Digit, OcrYuv):
|
|||||||
|
|
||||||
|
|
||||||
class DigitCounter(Ocr):
|
class DigitCounter(Ocr):
|
||||||
def __init__(self, buttons, lang='azur_lane', letter=(255, 255, 255), threshold=128, alphabet='0123456789/IDSB',
|
def __init__(self, buttons, lang='azur_lane', letter=(255, 255, 255), threshold=128, alphabet='0123456789/IDSBL',
|
||||||
name=None):
|
name=None):
|
||||||
super().__init__(buttons, lang=lang, letter=letter, threshold=threshold, alphabet=alphabet, name=name)
|
super().__init__(buttons, lang=lang, letter=letter, threshold=threshold, alphabet=alphabet, name=name)
|
||||||
|
|
||||||
def after_process(self, result):
|
def after_process(self, result):
|
||||||
result = super().after_process(result)
|
result = super().after_process(result)
|
||||||
result = result.replace('I', '1').replace('D', '0').replace('S', '5')
|
result = result.replace('I', '1').replace('D', '0').replace('S', '5')
|
||||||
result = result.replace('B', '8')
|
result = result.replace('B', '8').replace('L', '1')
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def ocr(self, image, direct_ocr=False):
|
def ocr(self, image, direct_ocr=False):
|
||||||
@@ -207,14 +207,14 @@ class DigitCounterYuv(DigitCounter, OcrYuv):
|
|||||||
|
|
||||||
|
|
||||||
class Duration(Ocr):
|
class Duration(Ocr):
|
||||||
def __init__(self, buttons, lang='azur_lane', letter=(255, 255, 255), threshold=128, alphabet='0123456789:IDSB',
|
def __init__(self, buttons, lang='azur_lane', letter=(255, 255, 255), threshold=128, alphabet='0123456789:IDSBL',
|
||||||
name=None):
|
name=None):
|
||||||
super().__init__(buttons, lang=lang, letter=letter, threshold=threshold, alphabet=alphabet, name=name)
|
super().__init__(buttons, lang=lang, letter=letter, threshold=threshold, alphabet=alphabet, name=name)
|
||||||
|
|
||||||
def after_process(self, result):
|
def after_process(self, result):
|
||||||
result = super().after_process(result)
|
result = super().after_process(result)
|
||||||
result = result.replace('I', '1').replace('D', '0').replace('S', '5')
|
result = result.replace('I', '1').replace('D', '0').replace('S', '5')
|
||||||
result = result.replace('B', '8')
|
result = result.replace('B', '8').replace('L', '1')
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def ocr(self, image, direct_ocr=False):
|
def ocr(self, image, direct_ocr=False):
|
||||||
|
|||||||
@@ -157,7 +157,9 @@ class Combat(Combat_, MapEventHandler):
|
|||||||
|
|
||||||
def combat_status(self, drop=None, expected_end=None):
|
def combat_status(self, drop=None, expected_end=None):
|
||||||
self.__os_combat_drop = drop
|
self.__os_combat_drop = drop
|
||||||
super().combat_status(drop=drop, expected_end=self._os_combat_expected_end)
|
if expected_end is None:
|
||||||
|
expected_end = self._os_combat_expected_end
|
||||||
|
super().combat_status(drop=drop, expected_end=expected_end)
|
||||||
|
|
||||||
def combat(self, *args, save_get_items=False, **kwargs):
|
def combat(self, *args, save_get_items=False, **kwargs):
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -9,7 +9,13 @@ if server.server != 'jp':
|
|||||||
else:
|
else:
|
||||||
OCR_SHOP_GEMS = Digit(SHOP_GEMS, letter=(190, 180, 82), name='OCR_SHOP_GEMS')
|
OCR_SHOP_GEMS = Digit(SHOP_GEMS, letter=(190, 180, 82), name='OCR_SHOP_GEMS')
|
||||||
# UI update in 20250814, but server TW is still old UI.
|
# UI update in 20250814, but server TW is still old UI.
|
||||||
if server.server != 'tw':
|
if server.server == 'jp':
|
||||||
|
OCR_SHOP_GOLD_COINS = Digit(SHOP_OCR_BALANCE, letter=(110, 120, 130), name='OCR_SHOP_GOLD_COINS')
|
||||||
|
OCR_SHOP_MEDAL = Digit(SHOP_OCR_BALANCE, letter=(110, 120, 130), name='OCR_SHOP_MEDAL')
|
||||||
|
OCR_SHOP_MERIT = Digit(SHOP_OCR_BALANCE, letter=(110, 120, 130), name='OCR_SHOP_MERIT')
|
||||||
|
OCR_SHOP_GUILD_COINS = Digit(SHOP_OCR_BALANCE, letter=(110, 120, 130), name='OCR_SHOP_GUILD_COINS')
|
||||||
|
OCR_SHOP_CORE = Digit(SHOP_OCR_BALANCE, letter=(110, 120, 130), name='OCR_SHOP_CORE')
|
||||||
|
elif server.server != 'tw':
|
||||||
OCR_SHOP_GOLD_COINS = Digit(SHOP_OCR_BALANCE, letter=(100, 100, 100), name='OCR_SHOP_GOLD_COINS')
|
OCR_SHOP_GOLD_COINS = Digit(SHOP_OCR_BALANCE, letter=(100, 100, 100), name='OCR_SHOP_GOLD_COINS')
|
||||||
OCR_SHOP_MEDAL = Digit(SHOP_OCR_BALANCE, letter=(100, 100, 100), name='OCR_SHOP_MEDAL')
|
OCR_SHOP_MEDAL = Digit(SHOP_OCR_BALANCE, letter=(100, 100, 100), name='OCR_SHOP_MEDAL')
|
||||||
OCR_SHOP_MERIT = Digit(SHOP_OCR_BALANCE, letter=(100, 100, 100), name='OCR_SHOP_MERIT')
|
OCR_SHOP_MERIT = Digit(SHOP_OCR_BALANCE, letter=(100, 100, 100), name='OCR_SHOP_MERIT')
|
||||||
|
|||||||
@@ -121,6 +121,27 @@ class ShopUI(UI):
|
|||||||
inactive_color=(252, 252, 253), inactive_threshold=221, inactive_count=100,
|
inactive_color=(252, 252, 253), inactive_threshold=221, inactive_count=100,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@Config.when(SERVER='jp')
|
||||||
|
def shop_tab_250814(self):
|
||||||
|
"""
|
||||||
|
Set with `self.shop_tab.set(main=self, upper={index})`
|
||||||
|
- index
|
||||||
|
1: General supply shops
|
||||||
|
2: Monthly shops
|
||||||
|
3: Event shops
|
||||||
|
"""
|
||||||
|
grids = ButtonGrid(
|
||||||
|
origin=(29, 436), delta=(0, 50),
|
||||||
|
button_shape=(74, 21), grid_shape=(1, 3),
|
||||||
|
name='SHOP_TAB')
|
||||||
|
return Navbar(
|
||||||
|
grids=grids,
|
||||||
|
# blue text active
|
||||||
|
active_color=(88, 186, 255), active_threshold=221, active_count=100,
|
||||||
|
# white text inactive
|
||||||
|
inactive_color=(38, 92, 121), inactive_threshold=221, inactive_count=100,
|
||||||
|
)
|
||||||
|
|
||||||
@cached_property
|
@cached_property
|
||||||
@Config.when(SERVER=None)
|
@Config.when(SERVER=None)
|
||||||
def shop_tab_250814(self):
|
def shop_tab_250814(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user