From cec7d1886c52aa0f908df10cb276a3dd535ef9af Mon Sep 17 00:00:00 2001 From: LmeSzinc <37934724+LmeSzinc@users.noreply.github.com> Date: Thu, 15 Jun 2023 22:12:47 +0800 Subject: [PATCH] Add: Set combat waves --- .../share/combat/prepare/OCR_WAVE_COUNT.png | Bin 0 -> 10715 bytes assets/share/combat/prepare/WAVE_MINUS.png | Bin 0 -> 5558 bytes assets/share/combat/prepare/WAVE_PLUS.png | Bin 0 -> 5854 bytes tasks/base/ui.py | 50 ++++++++++++++++++ tasks/combat/assets/assets_combat_prepare.py | 30 +++++++++++ tasks/combat/prepare.py | 41 ++++++++++++++ 6 files changed, 121 insertions(+) create mode 100644 assets/share/combat/prepare/OCR_WAVE_COUNT.png create mode 100644 assets/share/combat/prepare/WAVE_MINUS.png create mode 100644 assets/share/combat/prepare/WAVE_PLUS.png create mode 100644 tasks/combat/prepare.py diff --git a/assets/share/combat/prepare/OCR_WAVE_COUNT.png b/assets/share/combat/prepare/OCR_WAVE_COUNT.png new file mode 100644 index 0000000000000000000000000000000000000000..5fb499de0c96e24d9fec17e7dee694cb5df909c0 GIT binary patch literal 10715 zcmeHM2UinYxE)0WR6s;QiGYIAi>Pz~m8w#tg(e^%y@cLL@Olw02*{;L2`IfsnxTcD zNDW0ggkC}jEwm&A2)y{-&v7XBBKJiA09c-Ds~ZBq zdHUtq-%Mxe%@e*CXXp*Hm$tbt09@kubDjY*vTgvtMO_y)wO6m4A$|~FXNcGB=W1%V zy?h{!F76Hh5QK#r1)3#MI928-4s76O6Wdj3?(YD8fpVsk23sMm|=Y;7icg{?(0&ID1`t{@m>=E0~{7=i32bn;|#|>i13c_zVI9oCUl_ zCGTGCTsVE-_)5?exSa^h^IyeZI`hd8=#n( zf39*Km?%k_<^m>iZM zBT(mofOxY{Y){?*5$Vswdx6{XX8|={jy{IlIt*X#525EvY`h}twa);pn3TS>mqQP) z)u;UC4&2?IU%a#U)4l4MEtkj@N9JYzth7u44sASxPXA>9;HD1#IFVQVgk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xe>Fmp=iXIwTRSySseNT@Za$t0Tj! literal 0 HcmV?d00001 diff --git a/assets/share/combat/prepare/WAVE_MINUS.png b/assets/share/combat/prepare/WAVE_MINUS.png new file mode 100644 index 0000000000000000000000000000000000000000..46fc76ea5cb7ac9e6bd92dff2d1861d2c8d9284b GIT binary patch literal 5558 zcmeI0c{CJW8^^Cf&Di&`B#fm6$<|LogJj6o*eltJ?6QwNvXn5gWlbp25K<;tCfUal zWhc8yLt~$;z4QD3{qz0jJ;!s-eV%*nJ>UDB`}ym8o<}A|x~xosOaK5@J=7I60F1OP z-elILAP!po_Hrpr8whY+wWdNmf{Pq#cON(vs;0 zqAC!eeUiI}UetiT;QT<-bg8X(3?4-X2*mWB%xeRRJoxmlf`RL+)3ai;&F)oN_V6OM|0cK6n_$cW+?(35Q5=UA++g||ypw=Y*+-tte__(0CVYa4nR!Lh z;YGvwxde^BiZfo*3E|tc+r#nTRd7EWnN?0Giaxk+?-@{mP9hN*wB$XhB=N)cn23X< zGyStlRkvh#AFo+G!kZur+c6)}DObcg(`UJsA{5p{G7ey=fvf-*YfLcuaQr>doe=(; z4wArTH4p%h;Ty6~1esF+hqICbh6+Gx(@ru{nhx}27S91t|C9gL>omAQ8x(*m1rN?v zY943#%!4Da<$e~fC%_^0$F3k*BnWC8TF2%iPcXgU&(IVwBdCrrysxAeEa1$Z;i&m6 zufj^2=DPKO>1;|1n>$G^6e>52}nXD_cHYMLyl(mC@faj%D_tdwdAsR4Obo15*GbXzWEd)^|f)0 zWH8rGOOS(V71ru1PU^SVNwIv%+o#yLZBtPaY@JW%jhMtFu?l+3dTyw3lx(qSvBm(0 zORj+w8SBycV;))^i4)CCsl~Emji2syewnZ3QEiQ%HGmaLpo`PE^p)>kUSN3nTtO?V zpzL~2Y5sR;S-k4=8+slE0VZ;$ai!c!{@Ic}Iegm0V%eg>uh}lnF4TK+OMZ2*$>@_h znO`#p+^t9^!BS!K zPo)`<6N3oKl?f7Vr1av9(oAuU;I@)$bMSW$g`-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3fa}q z%YEW)Q&Tm}1AQU!BudqLAt%ynEN3M<@V)nqvuw?p3!hI-y$TJPGx_EZs>8Ts?X`0C z3U%FZ?}HiC+nZkGyHw(erCNpGrXl%KKjmA*t}9{CclginIh*I021?tqP_3ub_^rv3dE zH#4Bytve`wRXi~{PeeqBRj^_GPH*Z=Np%T#Ust%rUkusz4Qc9NcJErB)&9sT^G-rv zQw64U!-w*w^sQ>Uc)Lh_FGhXs)qZ*Jco+pwshetV5Xm~dk32Nl=-+j0FZpUr)gXl) z?#odhZtO`8JXfT-O;JY_+7N(XNdO|F0oeIVt4jd*p9kQV9RRA&0DyZvwQaphGof>O zS2WFn#+FB`SP7ymI-2q5AcpPdNu0N;A*`G!6jzCBO(BKKv`3HPh`8}u|Gl5>)FINa6!?G&Q97s(m^ujaq0|7#mslcV^* hCNRy+48Y&N^dSBVOxBM4zVhGS=;;_;snD{E`VY1Oc9{SG literal 0 HcmV?d00001 diff --git a/assets/share/combat/prepare/WAVE_PLUS.png b/assets/share/combat/prepare/WAVE_PLUS.png new file mode 100644 index 0000000000000000000000000000000000000000..d3b7cf97617225997bce7efad8883d03161e7e8d GIT binary patch literal 5854 zcmeI0`8O2)_s3rbWyz8?BqCaDrL@>185)eiAlZwoBl}n<5~UdXI`%LOQOYD+*&9og zeczL1?34X7z5j>r58rdT=e*8+z3zRU`#SgW(>?bETvwBYiJu7oz@i1cg8+b@dWC#v zfKZ*PkTwm~F}gubJpf?l{Cj9XYWgVvm~)(R!TAvY zzC$5gSr%V6{BS`6&<)B`~zIo93{`0_$h&9I8!W5ll!f?vv?IqsEY4 zCMYgqD(eE#{`Sj=`;kTuZmtN86nqHuBQG!S_3u^Br_b+qqPy5ICppAp=5idtEku~2 z{D4rj9<;Ho1_R-SPS6Rn&yl{`(>DRIN{jXl@+?!?r+JG45a8A;eU77L@+hC)76DqN4O_WD>nTuX@ctnahzGzK9iS!xidewXrj{~27{JGk@PdJy(|88( zng*m?&^!lG{S2&(o+2b6^kK{&Q5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a#7I@b4k^#AFXHqS)YkeinTDqY1#PZPze zw*Gi;FZ22^t-wai{i1!}?$-_-{644WI%fuh6daJGmQ#LXyV|d14{Lzo_ z$sWyi&0f*FqOYTILP7#8{59(jJL4t`-W70meG5V!p%*=h=f@AG_U?6=><_Fm??iUh zm7?(*?&M-nDHh_^wA$o)0+O zm!Uk{*c0o?yh@!mg>9h-9RU2q0KkL-uyaK93jlas2H>|90P@KI@Sb-BdF{n)o z09Ida#iDM}5y?j#a45%Cg4-Gc&&iaI2Q|EhP#0{N;C%Nlr~fSXo5hY+j(RP8_Qo(- zQR}Ug6g={4@omEW_)qoO+g`8d20Zh>hr+EBK{xcLc&HN&W-w&5xLC+p>$+jxf4RYs zgVuh2rB5@za~rgbE%V85@z;*6;4KHtrO$yEm4lJ=ZaPEZq}2mB@bpV`Tmd3@NMYzjo8iewXODMAqB&5U)PkpI*=pvZdz! k+5dL}6Txc&0303Bf}e2LnA6Ohsee1t($KwAs%91PKN;aC$^ZZW literal 0 HcmV?d00001 diff --git a/tasks/base/ui.py b/tasks/base/ui.py index d3bc30239..15f3c61b2 100644 --- a/tasks/base/ui.py +++ b/tasks/base/ui.py @@ -2,6 +2,7 @@ from module.base.decorator import run_once from module.base.timer import Timer from module.exception import GameNotRunningError, GamePageUnknownError from module.logger import logger +from module.ocr.ocr import Ocr from tasks.base.assets.assets_base_page import CLOSE from tasks.base.page import Page, page_main from tasks.base.popup import PopupHandler @@ -152,6 +153,55 @@ class UI(PopupHandler): self.ui_goto(destination, skip_first_screenshot=True) return True + def ui_ensure_index( + self, + index, + letter, + next_button, + prev_button, + skip_first_screenshot=False, + fast=True, + interval=(0.2, 0.3), + ): + """ + Args: + index (int): + letter (Ocr, callable): OCR button. + next_button (Button): + prev_button (Button): + skip_first_screenshot (bool): + fast (bool): Default true. False when index is not continuous. + interval (tuple, int, float): Seconds between two click. + """ + logger.hr("UI ensure index") + retry = Timer(1, count=2) + while 1: + if skip_first_screenshot: + skip_first_screenshot = False + else: + self.device.screenshot() + + if isinstance(letter, Ocr): + current = letter.ocr_single_line(self.device.image) + else: + current = letter(self.device.image) + + logger.attr("Index", current) + diff = index - current + if diff == 0: + break + if current == 0: + logger.warning(f'ui_ensure_index got an empty current value: {current}') + continue + + if retry.reached(): + button = next_button if diff > 0 else prev_button + if fast: + self.device.multi_click(button, n=abs(diff), interval=interval) + else: + self.device.click(button) + retry.reset() + def ui_goto_main(self): return self.ui_ensure(destination=page_main) diff --git a/tasks/combat/assets/assets_combat_prepare.py b/tasks/combat/assets/assets_combat_prepare.py index 2acd86550..d5d8e3942 100644 --- a/tasks/combat/assets/assets_combat_prepare.py +++ b/tasks/combat/assets/assets_combat_prepare.py @@ -13,3 +13,33 @@ COMBAT_PREPARE = ButtonWrapper( button=(956, 640, 1224, 676), ), ) +OCR_WAVE_COUNT = ButtonWrapper( + name='OCR_WAVE_COUNT', + share=Button( + file='./assets/share/combat/prepare/OCR_WAVE_COUNT.png', + area=(911, 549, 1151, 581), + search=(891, 529, 1171, 601), + color=(27, 29, 32), + button=(911, 549, 1151, 581), + ), +) +WAVE_MINUS = ButtonWrapper( + name='WAVE_MINUS', + share=Button( + file='./assets/share/combat/prepare/WAVE_MINUS.png', + area=(825, 577, 858, 599), + search=(805, 557, 878, 619), + color=(239, 239, 239), + button=(825, 577, 858, 599), + ), +) +WAVE_PLUS = ButtonWrapper( + name='WAVE_PLUS', + share=Button( + file='./assets/share/combat/prepare/WAVE_PLUS.png', + area=(1203, 578, 1239, 598), + search=(1183, 558, 1259, 618), + color=(23, 24, 25), + button=(1203, 578, 1239, 598), + ), +) diff --git a/tasks/combat/prepare.py b/tasks/combat/prepare.py new file mode 100644 index 000000000..e9e641807 --- /dev/null +++ b/tasks/combat/prepare.py @@ -0,0 +1,41 @@ +import re + +from module.logger import logger +from module.ocr.ocr import Ocr +from tasks.base.ui import UI +from tasks.combat.assets.assets_combat_prepare import OCR_WAVE_COUNT, WAVE_MINUS, WAVE_PLUS + + +class WaveCount(Ocr): + def after_process(self, result): + """ + Returns: + int: + """ + result = super().after_process(result) + logger.attr(name=self.name, text=str(result)) + + res = re.search(r'(\d)', result) + if res: + result = int(res.group(1)) + if 1 <= result <= 6: + return result + else: + logger.warning(f'Unexpected combat wave: {result}') + return 0 + else: + logger.warning('Cannot find wave count') + return 0 + + +class CombatPrepare(UI): + def combat_set_wave(self, count=6): + """ + Args: + count: 1 to 6 + """ + self.ui_ensure_index( + count, letter=WaveCount(OCR_WAVE_COUNT), + next_button=WAVE_PLUS, prev_button=WAVE_MINUS, + skip_first_screenshot=True + )