From fdcd2feb47f195fc06c709f2e714cc9a8debde9f Mon Sep 17 00:00:00 2001 From: LmeSzinc <37934724+LmeSzinc@users.noreply.github.com> Date: Sun, 1 Oct 2023 16:24:00 +0800 Subject: [PATCH] Add: Handle rogue reward --- assets/share/rogue/reward/ROGUE_REPORT.png | Bin 0 -> 6878 bytes tasks/rogue/assets/assets_rogue_reward.py | 15 ++++++ tasks/rogue/route/exit.py | 52 +++++++++++++++++++++ 3 files changed, 67 insertions(+) create mode 100644 assets/share/rogue/reward/ROGUE_REPORT.png create mode 100644 tasks/rogue/assets/assets_rogue_reward.py create mode 100644 tasks/rogue/route/exit.py diff --git a/assets/share/rogue/reward/ROGUE_REPORT.png b/assets/share/rogue/reward/ROGUE_REPORT.png new file mode 100644 index 0000000000000000000000000000000000000000..4cf9af5e6e6e910709bcec08e06986628449819a GIT binary patch literal 6878 zcmeI0_fwNkw8meWQlv_cfCd4TqJkjOr3R$;UPL+plp0C^5k!zCO-caiNB}{aNGM8^ zPy}hxd!&TWW2iTL@4s+=y5r95oOkBkne*&tpEGlI-{@+q(Nc3#0{}p)4pG(z01DzK z=}$^hVo>1GARz`SFNm2p0MJ~$m?S`EHah@NYq=;X>FPRr`gnRfdwN}0S5ms}^}^H9 z#oYk_0wxg#{-()zR=GL61HG~0#CCPMdpH2*MN;-KnB_CP1MFTgFe!9KMpGLzvoK~u zj5=P9QbQ2Yi+Q&iogT+To5vbiN^bE?m(+y>;;`7`@#AJpHs)jiHb@`F$i$ztn(qoc z(vOspn&3&$fpq*pg^{vA=E<)!tfId;QFH>pHW@4c?(<3hgrv$7AO*ZeMQ$>6FPuj- z>GGQZ*OP#GFcXG`BvBve5i#sx271_mPX?c#Q3ELe;0_B`1Op#wfz5q&ISOE+EP0v@ zn8?3YMhV1`02#N`Zjvf|1#FGN^@T{=z5#hi1+WNtTO~=DS-q$lX&8zE@QXK1q*t&7 z!ZH+v`he?_q<|9l)qb+;nq+zRhFj;$Y`h{HAtXQ>I<-Ij$*>r6W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 b/tasks/rogue/assets/assets_rogue_reward.py @@ -0,0 +1,15 @@ +from module.base.button import Button, ButtonWrapper + +# This file was auto-generated, do not modify it manually. To generate: +# ``` python -m dev_tools.button_extract ``` + +ROGUE_REPORT = ButtonWrapper( + name='ROGUE_REPORT', + share=Button( + file='./assets/share/rogue/reward/ROGUE_REPORT.png', + area=(1198, 19, 1223, 42), + search=(1178, 0, 1243, 62), + color=(203, 165, 119), + button=(382, 645, 894, 700), + ), +) diff --git a/tasks/rogue/route/exit.py b/tasks/rogue/route/exit.py new file mode 100644 index 000000000..448272a66 --- /dev/null +++ b/tasks/rogue/route/exit.py @@ -0,0 +1,52 @@ +from module.logger import logger +from tasks.base.page import page_rogue +from tasks.combat.interact import CombatInteract +from tasks.rogue.assets.assets_rogue_reward import ROGUE_REPORT +from tasks.rogue.assets.assets_rogue_ui import BLESSING_CONFIRM + + +class RogueExit(CombatInteract): + def domain_exit_interact(self, skip_first_screenshot=True): + """ + Pages: + in: page_main, DUNGEON_COMBAT_INTERACT + out: page_main + or page_rogue if rogue cleared + """ + logger.info(f'Domain exit interact') + clicked = False + while 1: + if skip_first_screenshot: + skip_first_screenshot = False + else: + self.device.screenshot() + + # End + if clicked and not self.is_in_main(): + break + + if self.handle_combat_interact(): + clicked = True + continue + if self.handle_popup_confirm(): + continue + + logger.info(f'Interact loading') + skip_first_screenshot = True + while 1: + if skip_first_screenshot: + skip_first_screenshot = False + else: + self.device.screenshot() + + # End + if self.is_in_main(): + logger.info('Entered another domain') + break + if self.ui_page_appear(page_rogue): + logger.info('Rogue cleared') + break + + if self.appear(ROGUE_REPORT, interval=2): + self.device.click(BLESSING_CONFIRM) + continue