From cfdb09f7c39e08a761a44774c4e676ad82dec17a Mon Sep 17 00:00:00 2001 From: Zebartin <16185081+Zebartin@users.noreply.github.com> Date: Sat, 8 Jul 2023 12:09:23 +0800 Subject: [PATCH] Opt: delay battle pass to next version if possible --- .../share/battle_pass/OCR_REMAINING_TIME.png | Bin 0 -> 17189 bytes module/config/config.py | 1 + module/ocr/ocr.py | 9 +++--- .../battle_pass/assets/assets_battle_pass.py | 10 +++++++ tasks/battle_pass/battle_pass.py | 26 ++++++++++++------ 5 files changed, 33 insertions(+), 13 deletions(-) create mode 100644 assets/share/battle_pass/OCR_REMAINING_TIME.png diff --git a/assets/share/battle_pass/OCR_REMAINING_TIME.png b/assets/share/battle_pass/OCR_REMAINING_TIME.png new file mode 100644 index 0000000000000000000000000000000000000000..30d967ec2f58ec2d9b72a858a8ac1d28882726af GIT binary patch literal 17189 zcmeHu_g|8G_&1gv<9O1Jb}DmKX6DHi<{p%lBUfc*W{Q?*=D?9#q+!}HO)+s(xia^{ zfr9DDt*Dp-R5DXSL|lk~z(ddX`!75{J^jGzg4c^1?)&;&^L@Rq7grpt_WgO}PXGY0 z&&K-VH2`3b=FRm0X9$_U4_v%t{ody4mCHx>18*ECyeR(no8y;`7QQ=Bbn;RB*)&ZdJ7&cU zTc^!zb4AYZ7oxTYsCjI-&roit_eu!UfI6Tdm*C0p5)<7I;LqE}!e5UAIB)_WE)tJA z#2<+S;7TT7|1bHcEMS*Nob%juP9y-Q>;QXz$!9>ougl-*h#eIPz=4y$FaE8t|0hOL zt%`&)rvGhkV19fnF;u1LKbWnz;fF+2k5>xS{HAIbkkF~>SkAg9ZM2Av>-Wp}TIO8k z%A{O^K0ZOKi&FDDQ$DV&SO{UmD(Th41u7#+^yyOFle?CRi~$~ z2e^YRav>ZSbKh01+G)9~vP0}!eb(b_Kv0=~m}27wt1s|~ocSL804s`xh845SI* zIyc_fI<-UU&_7tH`q8!K?j>>{$}QZ5J@x5E8R=9z4k5j{PU?8Y0R+8&2YXLweCr1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DxRhSjLtUP_UmC5qxB+Z9AG{zy5uH>Nu9sq#%)T;J@M~c?Fo+^EOD9QIU z7qkjf(GvpBcHJ|JNA{`k5_)}+eu);GOoKYT=Bd%^xWVrU245e-qod?chmOY)F*ne# zm+Y4bWmG{V>l5<9Vavm5z&&8B>+h7lo!l%{RQo3xp(CHM(UhA*oh-RN}1Hz*s z>al;#jy`@H_5(2S?u#X$(nVLe`chQAuiV0hui!##QGtj5)o`he<3f`<6Vh{3oetK) z5NMXteXn}wjAbIq7fx=TXuhZEqRTdJ<2Nn)kuau1O^lq;1lr$^YK(YQdBW(M!iCsH z)8s*JIh_KXx~T#P%}c5(3cQKsu5B3im&3!uZO65CuB2qHG`^-$y=vl;f+61U*jya$ z3PSsO35^l4xDh6JCe*`=XySCu9eMrshC<=h+1R=l7nZ>?IrLKt|i#w)N++(0X zM*QR>a@GYy0AOa{ZJ&)7euci3eODACoGrU{J&Yox&42BIgo`ka6JUr^0-Ue!Cw|}=H7Se=C37rqGq&w*{iNCJ88|@ zi)blReY0#|g%FK{OHk|@I|p>5Mgn3>EoiUU*Aag470U+7W!t@(*%G?cZ(qQ7!c1`JJ2?QY*Z&rG4YyszVi8UvgOF}-9Ris>(f0Jz zy?4SRi7A<>)?sP6f3a>Ed-uz<(=(ovKd(*5jU#rG-HS^etej$zZqJ9?H>TP*maWtLG5A^0|*iG-}NLSc>M6SUCZgox1&5HRY85w_q;Uw zlpvbQ-L4#;904ct1VovE0vGbG&%3Aqy61W}*DyuFlLktkztV%;bfir7pj`t)^S|f# zot|Ko`@wu}@JYR#zNkLDbE0DSWYFh5hsymnwkaQT$-$62L30y}|CeR00(hL)VS!j? zgX1GGI!6(cC8Ew|&JNf+60%*RiW5lsnT;xM*UO248Z1+!^KJqk0<{J DeB_pM literal 0 HcmV?d00001 diff --git a/module/config/config.py b/module/config/config.py index 6e2520c81..aaeea7101 100644 --- a/module/config/config.py +++ b/module/config/config.py @@ -264,6 +264,7 @@ class AzurLaneConfig(ConfigUpdater, ManualConfig, GeneratedConfig, ConfigWatcher if isinstance(next_run, datetime) and next_run > limit: deep_set(self.data, keys=f"{task}.Scheduler.NextRun", value=now) + limit_next_run(['BattlePass'], limit=now + timedelta(days=31, seconds=-1)) limit_next_run(self.args.keys(), limit=now + timedelta(hours=24, seconds=-1)) def override(self, **kwargs): diff --git a/module/ocr/ocr.py b/module/ocr/ocr.py index d8e669bdd..fd5711db8 100644 --- a/module/ocr/ocr.py +++ b/module/ocr/ocr.py @@ -283,14 +283,14 @@ class Duration(Ocr): @cached_property def timedelta_regex(self): regex_str = { - 'ch': r'\D*((?P\d{1,2})小时)?((?P\d{1,2})分钟)?((?P\d{1,2})秒})?', - 'en': r'\D*((?P\d{1,2})h\s*)?((?P\d{1,2})m\s*)?((?P\d{1,2})s)?' + 'ch': r'\D*((?P\d{1,2})天)?((?P\d{1,2})小时)?((?P\d{1,2})分钟)?((?P\d{1,2})秒})?', + 'en': r'\D*((?P\d{1,2})d\s*)?((?P\d{1,2})h\s*)?((?P\d{1,2})m\s*)?((?P\d{1,2})s)?' }[self.lang] return re.compile(regex_str) def format_result(self, result: str) -> timedelta: """ - Do OCR on a duration, such as `2h 13m 30s`, `2h`, `13m 30s`, `9s` + Do OCR on a duration, such as `18d 2h 13m 30s`, `2h`, `13m 30s`, `9s` Returns: timedelta: @@ -298,10 +298,11 @@ class Duration(Ocr): matched = self.timedelta_regex.match(result) if matched is None: return timedelta() + days = self._sanitize_number(matched.group('days')) hours = self._sanitize_number(matched.group('hours')) minutes = self._sanitize_number(matched.group('minutes')) seconds = self._sanitize_number(matched.group('seconds')) - return timedelta(hours=hours, minutes=minutes, seconds=seconds) + return timedelta(days=days, hours=hours, minutes=minutes, seconds=seconds) @staticmethod def _sanitize_number(number) -> int: diff --git a/tasks/battle_pass/assets/assets_battle_pass.py b/tasks/battle_pass/assets/assets_battle_pass.py index 2ac516e5e..df6c7aecb 100644 --- a/tasks/battle_pass/assets/assets_battle_pass.py +++ b/tasks/battle_pass/assets/assets_battle_pass.py @@ -63,6 +63,16 @@ OCR_LEVEL = ButtonWrapper( button=(183, 93, 240, 134), ), ) +OCR_REMAINING_TIME = ButtonWrapper( + name='OCR_REMAINING_TIME', + share=Button( + file='./assets/share/battle_pass/OCR_REMAINING_TIME.png', + area=(289, 89, 630, 132), + search=(269, 69, 650, 152), + color=(66, 63, 57), + button=(289, 89, 630, 132), + ), +) REWARDS_CHECK = ButtonWrapper( name='REWARDS_CHECK', share=Button( diff --git a/tasks/battle_pass/battle_pass.py b/tasks/battle_pass/battle_pass.py index 4bfdc4152..b12a5efb8 100644 --- a/tasks/battle_pass/battle_pass.py +++ b/tasks/battle_pass/battle_pass.py @@ -3,7 +3,7 @@ import numpy as np from module.base.timer import Timer from module.base.utils import get_color from module.logger.logger import logger -from module.ocr.ocr import Digit +from module.ocr.ocr import Digit, Duration from module.ui.switch import Switch from tasks.base.assets.assets_base_page import BATTLE_PASS_CHECK from tasks.base.assets.assets_base_popup import GET_REWARD @@ -26,6 +26,8 @@ SWITCH_BATTLE_PASS_TAB.add_state( class BattlePassUI(UI): + MAX_LEVEL = 50 + def _battle_pass_wait_rewards_loaded(self, skip_first_screenshot=True): timeout = Timer(2, count=4).start() while 1: @@ -150,6 +152,9 @@ class BattlePassUI(UI): digit = Digit(OCR_LEVEL) return digit.ocr_single_line(self.device.image) + def _get_remaining_time(self): + return Duration(OCR_REMAINING_TIME).ocr_single_line(self.device.image) + def claim_battle_pass_rewards(self): """ Examples: @@ -159,16 +164,19 @@ class BattlePassUI(UI): """ self.ui_ensure(page_battle_pass) previous_level = self._get_battle_pass_level() + if previous_level == self.MAX_LEVEL: + return previous_level claimed_exp = self._claim_exp() - if claimed_exp and previous_level != 50 and self._get_battle_pass_level() > previous_level: + current_level = self._get_battle_pass_level() + if claimed_exp and current_level > previous_level: logger.info("Upgraded, go to claim rewards") self._claim_rewards() - return True + return current_level def run(self): - for _ in range(5): - claimed = self.claim_battle_pass_rewards() - if claimed: - break - - self.config.task_delay(server_update=True) + current_level = self.claim_battle_pass_rewards() + if current_level == self.MAX_LEVEL: + remaining_time = self._get_remaining_time() + self.config.task_delay(minute=remaining_time.total_seconds() / 60) + else: + self.config.task_delay(server_update=True)