diff --git a/assets/jp/base/page/MAIN_GO_TO_CAFE.png b/assets/jp/base/page/MAIN_GO_TO_CAFE.png new file mode 100644 index 0000000..6d0a0b9 Binary files /dev/null and b/assets/jp/base/page/MAIN_GO_TO_CAFE.png differ diff --git a/assets/jp/base/page/MAIN_GO_TO_CIRCLE.png b/assets/jp/base/page/MAIN_GO_TO_CIRCLE.png new file mode 100644 index 0000000..f6073b7 Binary files /dev/null and b/assets/jp/base/page/MAIN_GO_TO_CIRCLE.png differ diff --git a/assets/jp/base/page/MAIN_GO_TO_CRAFTING.png b/assets/jp/base/page/MAIN_GO_TO_CRAFTING.png new file mode 100644 index 0000000..d877fb5 Binary files /dev/null and b/assets/jp/base/page/MAIN_GO_TO_CRAFTING.png differ diff --git a/assets/jp/base/page/MAIN_GO_TO_GACHA.png b/assets/jp/base/page/MAIN_GO_TO_GACHA.png new file mode 100644 index 0000000..ee35809 Binary files /dev/null and b/assets/jp/base/page/MAIN_GO_TO_GACHA.png differ diff --git a/assets/jp/base/page/MAIN_GO_TO_SCHEDULE.png b/assets/jp/base/page/MAIN_GO_TO_SCHEDULE.png new file mode 100644 index 0000000..77b2884 Binary files /dev/null and b/assets/jp/base/page/MAIN_GO_TO_SCHEDULE.png differ diff --git a/assets/jp/base/page/MAIN_GO_TO_SHOP.png b/assets/jp/base/page/MAIN_GO_TO_SHOP.png new file mode 100644 index 0000000..31530c6 Binary files /dev/null and b/assets/jp/base/page/MAIN_GO_TO_SHOP.png differ diff --git a/assets/jp/circle/CIRCLE.BUTTON.png b/assets/jp/circle/CIRCLE.BUTTON.png new file mode 100644 index 0000000..cb57602 Binary files /dev/null and b/assets/jp/circle/CIRCLE.BUTTON.png differ diff --git a/assets/jp/circle/CIRCLE.png b/assets/jp/circle/CIRCLE.png new file mode 100644 index 0000000..94fbbdd Binary files /dev/null and b/assets/jp/circle/CIRCLE.png differ diff --git a/tasks/base/assets/assets_base_page.py b/tasks/base/assets/assets_base_page.py index f24ba41..a97bd86 100644 --- a/tasks/base/assets/assets_base_page.py +++ b/tasks/base/assets/assets_base_page.py @@ -171,6 +171,13 @@ MAIL_CHECK = ButtonWrapper( ) MAIN_GO_TO_CAFE = ButtonWrapper( name='MAIN_GO_TO_CAFE', + jp=Button( + file='./assets/jp/base/page/MAIN_GO_TO_CAFE.png', + area=(76, 638, 104, 674), + search=(56, 618, 124, 694), + color=(173, 212, 230), + button=(76, 638, 104, 674), + ), share=Button( file='./assets/share/base/page/MAIN_GO_TO_CAFE.png', area=(81, 638, 102, 668), @@ -181,6 +188,13 @@ MAIN_GO_TO_CAFE = ButtonWrapper( ) MAIN_GO_TO_CIRCLE = ButtonWrapper( name='MAIN_GO_TO_CIRCLE', + jp=Button( + file='./assets/jp/base/page/MAIN_GO_TO_CIRCLE.png', + area=(486, 630, 522, 665), + search=(466, 610, 542, 685), + color=(166, 228, 245), + button=(486, 630, 522, 665), + ), share=Button( file='./assets/share/base/page/MAIN_GO_TO_CIRCLE.png', area=(540, 631, 583, 660), @@ -191,6 +205,13 @@ MAIN_GO_TO_CIRCLE = ButtonWrapper( ) MAIN_GO_TO_CRAFTING = ButtonWrapper( name='MAIN_GO_TO_CRAFTING', + jp=Button( + file='./assets/jp/base/page/MAIN_GO_TO_CRAFTING.png', + area=(626, 623, 654, 664), + search=(606, 603, 674, 684), + color=(190, 228, 241), + button=(626, 623, 654, 664), + ), share=Button( file='./assets/share/base/page/MAIN_GO_TO_CRAFTING.png', area=(665, 622, 693, 664), @@ -201,6 +222,13 @@ MAIN_GO_TO_CRAFTING = ButtonWrapper( ) MAIN_GO_TO_GACHA = ButtonWrapper( name='MAIN_GO_TO_GACHA', + jp=Button( + file='./assets/jp/base/page/MAIN_GO_TO_GACHA.png', + area=(898, 631, 927, 663), + search=(878, 611, 947, 683), + color=(170, 229, 247), + button=(898, 631, 927, 663), + ), share=Button( file='./assets/share/base/page/MAIN_GO_TO_GACHA.png', area=(900, 623, 924, 670), @@ -241,6 +269,13 @@ MAIN_GO_TO_PURCHASE = ButtonWrapper( ) MAIN_GO_TO_SCHEDULE = ButtonWrapper( name='MAIN_GO_TO_SCHEDULE', + jp=Button( + file='./assets/jp/base/page/MAIN_GO_TO_SCHEDULE.png', + area=(217, 640, 237, 672), + search=(197, 620, 257, 692), + color=(154, 201, 228), + button=(217, 640, 237, 672), + ), share=Button( file='./assets/share/base/page/MAIN_GO_TO_SCHEDULE.png', area=(194, 638, 216, 672), @@ -251,6 +286,13 @@ MAIN_GO_TO_SCHEDULE = ButtonWrapper( ) MAIN_GO_TO_SHOP = ButtonWrapper( name='MAIN_GO_TO_SHOP', + jp=Button( + file='./assets/jp/base/page/MAIN_GO_TO_SHOP.png', + area=(756, 629, 795, 666), + search=(736, 609, 815, 686), + color=(151, 215, 241), + button=(756, 629, 795, 666), + ), share=Button( file='./assets/share/base/page/MAIN_GO_TO_SHOP.png', area=(773, 630, 816, 667), diff --git a/tasks/circle/assets/assets_circle.py b/tasks/circle/assets/assets_circle.py index 2a5f4e3..6683b7f 100644 --- a/tasks/circle/assets/assets_circle.py +++ b/tasks/circle/assets/assets_circle.py @@ -3,6 +3,17 @@ 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 ``` +CIRCLE = ButtonWrapper( + name='CIRCLE', + jp=Button( + file='./assets/jp/circle/CIRCLE.png', + area=(197, 315, 228, 350), + search=(177, 295, 248, 370), + color=(166, 215, 235), + button=(188, 299, 435, 456), + ), + en=None, +) GET_REWARD_AP = ButtonWrapper( name='GET_REWARD_AP', jp=Button( diff --git a/tasks/circle/circle.py b/tasks/circle/circle.py index 5e7caf4..6a078fc 100644 --- a/tasks/circle/circle.py +++ b/tasks/circle/circle.py @@ -1,8 +1,9 @@ from enum import Enum +from module.base.decorator import Config from module.base.timer import Timer from module.logger import logger -from tasks.base.page import page_circle +from tasks.base.page import page_circle, MAIN_GO_TO_CIRCLE, CIRCLE_CHECK from tasks.base.ui import UI from tasks.circle.assets.assets_circle import * @@ -17,6 +18,23 @@ class CircleStatus(Enum): class Circle(UI): + @Config.when(Emulator_GameLanguage='jp') + def _enter_circle(self): + self.ui_goto_main() + action_timer = Timer(1, 8) + while not self.appear(CIRCLE_CHECK): + self.device.screenshot() + if not action_timer.reached_and_reset(): + continue + if self.appear_then_click(CIRCLE): + continue + else: + self.device.click(MAIN_GO_TO_CIRCLE) + + @Config.when(Emulator_GameLanguage=None) + def _enter_circle(self): + self.ui_ensure(page_circle) + def _handle_circle(self, status): match status: case CircleStatus.REWARD: @@ -31,7 +49,7 @@ class Circle(UI): return status def run(self): - self.ui_ensure(page_circle) + self._enter_circle() status = CircleStatus.REWARD action_timer = Timer(0.5)