Просмотр исходного кода

Merge pull request #1338 from runhey/dev

Automated PR 2026.01.01
huangrunheng 10 месяцев назад
Родитель
Сommit
cac23c0b4f
33 измененных файлов с 130 добавлено и 81 удалено
  1. 23 3
      module/server/app.py
  2. 16 3
      module/server/main_manager.py
  3. 3 1
      module/server/script_process.py
  4. 2 3
      module/server/script_router.py
  5. 4 1
      script.py
  6. 12 1
      tasks/ActivityShikigami/script_task.py
  7. 0 2
      tasks/AreaBoss/assets.py
  8. 1 1
      tasks/AreaBoss/script_task.py
  9. 4 2
      tasks/BondlingFairyland/script_task.py
  10. 1 1
      tasks/Component/Summon/summon.py
  11. 0 1
      tasks/Delegation/script_task.py
  12. 4 4
      tasks/Exploration/base.py
  13. 8 8
      tasks/GameUi/assets.py
  14. 9 9
      tasks/GameUi/page.py
  15. BIN
      tasks/GameUi/page/page_exploration_goto_awake_zone.png
  16. BIN
      tasks/GameUi/page/page_exploration_goto_bondling_fairyland.png
  17. BIN
      tasks/GameUi/page/page_exploration_goto_delegation.png
  18. BIN
      tasks/GameUi/page/page_exploration_goto_secret_zones.png
  19. 13 13
      tasks/GameUi/page/page_img.json
  20. 2 2
      tasks/GameUi/page/page_img_3.json
  21. BIN
      tasks/GameUi/page/page_main_goto_guild.png
  22. 1 1
      tasks/GoryouRealm/script_task.py
  23. 2 2
      tasks/KekkaiActivation/script_task.py
  24. 2 0
      tasks/KekkaiUtilize/script_task.py
  25. 1 1
      tasks/Orochi/script_task.py
  26. 5 5
      tasks/RichMan/assets.py
  27. 1 1
      tasks/RichMan/mall/friendship_points.py
  28. 2 2
      tasks/RichMan/mall/friendship_points/image.json
  29. 8 8
      tasks/RichMan/mall/medal/image.json
  30. 1 1
      tasks/RyouToppa/assets.py
  31. 2 2
      tasks/RyouToppa/res/image.json
  32. 1 1
      tasks/Secret/script_task.py
  33. 2 2
      tasks/WantedQuests/script_task.py

+ 23 - 3
module/server/app.py

@@ -4,15 +4,17 @@
 from contextlib import asynccontextmanager
 from contextlib import asynccontextmanager
 
 
 import argparse
 import argparse
+from starlette import status
+from starlette.responses import JSONResponse
 from fastapi import FastAPI, Request
 from fastapi import FastAPI, Request
 from fastapi.middleware.cors import CORSMiddleware
 from fastapi.middleware.cors import CORSMiddleware
 
 
 from module.logger import logger
 from module.logger import logger
-
 from module.server.home_router import home_app
 from module.server.home_router import home_app
 from module.server.script_router import script_app
 from module.server.script_router import script_app
-from starlette import status
-from starlette.responses import JSONResponse
+from module.server.setting import State
+from module.server.main_manager import mm
+
 
 
 
 
 @asynccontextmanager
 @asynccontextmanager
@@ -20,6 +22,7 @@ async def lifespan(app: FastAPI):
     await on_startup()
     await on_startup()
     yield
     yield
     await on_shutdown()
     await on_shutdown()
+
 app = FastAPI(
 app = FastAPI(
     title='OAS',
     title='OAS',
     description='OAS web service',
     description='OAS web service',
@@ -40,7 +43,13 @@ app.include_router(script_app)
 
 
 
 
 async def on_startup():
 async def on_startup():
+    """
+    app.state 的生命周期在定义app的时候就有了
+    :return:
+    """
     logger.info('OAS web service startup done')
     logger.info('OAS web service startup done')
+    if app.state.script_instances:
+        await mm.restart_processes(app.state.script_instances)
 
 
 
 
 async def on_shutdown():
 async def on_shutdown():
@@ -78,5 +87,16 @@ def fastapi_app():
         help="Run OAS by config names on startup",
         help="Run OAS by config names on startup",
     )
     )
     args, _ = parser.parse_known_args()
     args, _ = parser.parse_known_args()
+    # ------------------------------------------------------------------------------------------------------------------
+
+    runs = None
+    if args.run:
+        runs = args.run
+    elif State.deploy_config.Run:
+        # TODO: refactor poor_yaml_read() to support list
+        tmp = State.deploy_config.Run.split(",")
+        runs = [l.strip(" ['\"]") for l in tmp if len(l)]
+    # ------------------------------------------------------------------------------------------------------------------
+    app.state.script_instances = runs
 
 
     return app
     return app

+ 16 - 3
module/server/main_manager.py

@@ -42,6 +42,10 @@ class MainManager(ConfigManager):
     #         self.config_cache = Config(config_name)
     #         self.config_cache = Config(config_name)
     #     return self.config_cache
     #     return self.config_cache
 
 
+    @staticmethod
+    def config_cache(name: str) -> Config:
+        return Config(name)
+
     def add_script_file(self, file_name: str):
     def add_script_file(self, file_name: str):
         # 当你添加了新的脚本文件后,需要添加缓存的列表
         # 当你添加了新的脚本文件后,需要添加缓存的列表
         if file_name in self._all_script_files:
         if file_name in self._all_script_files:
@@ -95,7 +99,16 @@ class MainManager(ConfigManager):
                     tasks[coroutine_log_name] = asyncio.create_task(script_p.coroutine_broadcast_log(),
                     tasks[coroutine_log_name] = asyncio.create_task(script_p.coroutine_broadcast_log(),
                                                                     name=coroutine_log_name)
                                                                     name=coroutine_log_name)
 
 
-    @staticmethod
-    def config_cache(name: str) -> Config:
-        return Config(name)
+    async def restart_processes(self, script_instances: list[str]):
+        for instance in script_instances:
+            logger.info(f'Restart script {instance}')
+            if instance not in self.script_process:
+                try:
+                    self.script_process[instance] = ScriptProcess(instance)
+                except FileNotFoundError:
+                    logger.error(f'{instance} file not found')
+                    continue
+            await self.script_process[instance].start()
+
 
 
+mm = MainManager()

+ 3 - 1
module/server/script_process.py

@@ -9,7 +9,7 @@ from asyncio import QueueEmpty, CancelledError, sleep
 from enum import Enum
 from enum import Enum
 
 
 from module.logger import logger
 from module.logger import logger
-
+from module.server.config_manager import ConfigManager
 from module.server.script_websocket import ScriptWSManager
 from module.server.script_websocket import ScriptWSManager
 
 
 
 
@@ -24,6 +24,8 @@ class ScriptProcess(ScriptWSManager):
 
 
     def __init__(self, config_name: str) -> None:
     def __init__(self, config_name: str) -> None:
         super().__init__()
         super().__init__()
+        if config_name not in ConfigManager.all_script_files():
+            raise FileNotFoundError(f'{config_name}.json not found')
         self.config_name = config_name  # config_name
         self.config_name = config_name  # config_name
         self.log_pipe_out, self.log_pipe_in = multiprocessing.Pipe(False)
         self.log_pipe_out, self.log_pipe_in = multiprocessing.Pipe(False)
         self.state_queue = multiprocessing.Queue()
         self.state_queue = multiprocessing.Queue()

+ 2 - 3
module/server/script_router.py

@@ -6,18 +6,17 @@ from fastapi import APIRouter, HTTPException
 from fastapi.responses import StreamingResponse
 from fastapi.responses import StreamingResponse
 from fastapi import WebSocket, WebSocketDisconnect
 from fastapi import WebSocket, WebSocketDisconnect
 from datetime import datetime
 from datetime import datetime
-from module.config.config import Config
 from module.config.utils import convert_to_underscore
 from module.config.utils import convert_to_underscore
 
 
 from module.logger import logger
 from module.logger import logger
-from module.server.main_manager import MainManager
+from module.server.main_manager import mm
 from module.server.script_process import ScriptProcess, ScriptState
 from module.server.script_process import ScriptProcess, ScriptState
 
 
 from tasks.Component.config_base import TimeDelta
 from tasks.Component.config_base import TimeDelta
 
 
 
 
 script_app = APIRouter()
 script_app = APIRouter()
-mm = MainManager()
+
 
 
 @script_app.get('/test')
 @script_app.get('/test')
 async def script_test():
 async def script_test():

+ 4 - 1
script.py

@@ -101,8 +101,11 @@ class Script:
         if self.config.script.error.save_error:
         if self.config.script.error.save_error:
             if not os.path.exists('./log/error'):
             if not os.path.exists('./log/error'):
                 os.mkdir('./log/error')
                 os.mkdir('./log/error')
-            folder = f'./log/error/{int(time.time() * 1000)}'
+            folder_name = str(int(time.time() * 1000))
+            folder = f'./log/error/{folder_name}'
             logger.warning(f'Saving error: {folder}')
             logger.warning(f'Saving error: {folder}')
+            logger.info('保存详细错误的日志和截图到路径:')
+            logger.info(f'{str( Path.cwd() / "log" / "error" / folder_name)}')
             os.mkdir(folder)
             os.mkdir(folder)
             for data in self.device.screenshot_deque:
             for data in self.device.screenshot_deque:
                 image_time = datetime.strftime(data['time'], '%Y-%m-%d_%H-%M-%S-%f')
                 image_time = datetime.strftime(data['time'], '%Y-%m-%d_%H-%M-%S-%f')

+ 12 - 1
tasks/ActivityShikigami/script_task.py

@@ -341,9 +341,20 @@ class ScriptTask(StateMachine, GameUi, BaseActivity, SwitchSoul, ActivityShikiga
             # 战斗成功
             # 战斗成功
             if self.appear_then_click(self.I_WIN, interval=2):
             if self.appear_then_click(self.I_WIN, interval=2):
                 continue
                 continue
+            #  出现 “魂” 和 紫蛇皮
             if self.appear(self.I_REWARD):
             if self.appear(self.I_REWARD):
                 logger.info('Win battle')
                 logger.info('Win battle')
-                self.ui_click_until_disappear(self.I_REWARD, interval=1.5)
+                while 1:
+                    self.screenshot()
+                    appear_reward = self.appear_then_click(self.I_REWARD)
+                    appear_reward_purple_snake_skin = self.appear(self.I_REWARD_PURPLE_SNAKE_SKIN)
+                    if not appear_reward and not appear_reward_purple_snake_skin:
+                        break
+                    if appear_reward or appear_reward_purple_snake_skin:
+                        reward_click = random.choice(
+                            [self.C_RANDOM_LEFT, self.C_RANDOM_RIGHT, self.C_RANDOM_TOP])
+                        self.click(reward_click, interval=1.8)
+                        continue
                 return True
                 return True
             # 已经不在战斗中了, 且奖励也识别过了, 则随机点击
             # 已经不在战斗中了, 且奖励也识别过了, 则随机点击
             # if ok_cnt > 0 and not self.is_in_battle(False):
             # if ok_cnt > 0 and not self.is_in_battle(False):

+ 0 - 2
tasks/AreaBoss/assets.py

@@ -61,8 +61,6 @@ class AreaBossAssets:
 	I_EXPLORE = RuleImage(roi_front=(758,122,66,77), roi_back=(339,104,836,120), threshold=0.8, method="Template matching", file="./tasks/AreaBoss/res/res_explore.png")
 	I_EXPLORE = RuleImage(roi_front=(758,122,66,77), roi_back=(339,104,836,120), threshold=0.8, method="Template matching", file="./tasks/AreaBoss/res/res_explore.png")
 	# 地狱鬼王图标 
 	# 地狱鬼王图标 
 	I_AREA_BOSS = RuleImage(roi_front=(639,636,65,68), roi_back=(606,619,145,100), threshold=0.8, method="Template matching", file="./tasks/AreaBoss/res/res_area_boss.png")
 	I_AREA_BOSS = RuleImage(roi_front=(639,636,65,68), roi_back=(606,619,145,100), threshold=0.8, method="Template matching", file="./tasks/AreaBoss/res/res_area_boss.png")
-	# 蓝色的返回 
-	I_BACK_BLUE = RuleImage(roi_front=(51,30,51,52), roi_back=(4,1,128,110), threshold=0.8, method="Template matching", file="./tasks/AreaBoss/res/res_back_blue.png")
 	# 右上边选中鬼王的 
 	# 右上边选中鬼王的 
 	I_FILTER = RuleImage(roi_front=(1116,33,35,31), roi_back=(1076,19,98,78), threshold=0.8, method="Template matching", file="./tasks/AreaBoss/res/res_filter.png")
 	I_FILTER = RuleImage(roi_front=(1116,33,35,31), roi_back=(1076,19,98,78), threshold=0.8, method="Template matching", file="./tasks/AreaBoss/res/res_filter.png")
 	# 除悬赏外 选中第一个鬼王的 
 	# 除悬赏外 选中第一个鬼王的 

+ 1 - 1
tasks/AreaBoss/script_task.py

@@ -84,7 +84,7 @@ class ScriptTask(GeneralBattle, GameUi, SwitchSoul, AreaBossAssets):
         logger.info("Script back home")
         logger.info("Script back home")
         while 1:
         while 1:
             self.screenshot()
             self.screenshot()
-            if self.appear_then_click(self.I_BACK_BLUE, threshold=0.6, interval=2):
+            if self.appear_then_click(self.I_UI_BACK_YELLOW, threshold=0.6, interval=2):
                 continue
                 continue
             if self.appear(self.I_CHECK_MAIN, threshold=0.6):
             if self.appear(self.I_CHECK_MAIN, threshold=0.6):
                 break
                 break

+ 4 - 2
tasks/BondlingFairyland/script_task.py

@@ -795,10 +795,12 @@ if __name__ == '__main__':
     from module.config.config import Config
     from module.config.config import Config
     from module.device.device import Device
     from module.device.device import Device
 
 
-    config = Config('SWITCH')
+    config = Config('oas1')
     device = Device(config)
     device = Device(config)
     t = ScriptTask(config, device)
     t = ScriptTask(config, device)
-    t.run()
+    # t.run()
+    t.ui_get_current_page()
+    t.ui_goto(page_bondling_fairyland)
     # image = task.screenshot()
     # image = task.screenshot()
 
 
     # con = config.bondling_fairyland
     # con = config.bondling_fairyland

+ 1 - 1
tasks/Component/Summon/summon.py

@@ -143,7 +143,7 @@ class Summon(BaseTask, SummonAssets):
             self.screenshot()
             self.screenshot()
             if self.appear(self.I_BLUE_TICKET):
             if self.appear(self.I_BLUE_TICKET):
                 break
                 break
-            if self.appear_then_click(self.I_UI_BACK_BLUE):
+            if self.appear_then_click(self.I_UI_BACK_YELLOW):
                 continue
                 continue
             if self.appear_then_click(self.I_UI_BACK_YELLOW):
             if self.appear_then_click(self.I_UI_BACK_YELLOW):
                 continue
                 continue

+ 0 - 1
tasks/Delegation/script_task.py

@@ -130,7 +130,6 @@ class ScriptTask(GameUi, DelegationAssets):
 if __name__ == '__main__':
 if __name__ == '__main__':
     from module.config.config import Config
     from module.config.config import Config
     from module.device.device import Device
     from module.device.device import Device
-    from memory_profiler import profile
     c = Config('oas1')
     c = Config('oas1')
     d = Device(c)
     d = Device(c)
     t = ScriptTask(c, d)
     t = ScriptTask(c, d)

+ 4 - 4
tasks/Exploration/base.py

@@ -327,9 +327,9 @@ class BaseExploration(GameUi, GeneralBattle, GeneralRoom, GeneralInvite, Replace
         # 设置下次执行行时间
         # 设置下次执行行时间
         logger.info("RealmRaid and Exploration  set_next_run !")
         logger.info("RealmRaid and Exploration  set_next_run !")
         next_run = datetime.now() + con_scrolls.scrolls_cd
         next_run = datetime.now() + con_scrolls.scrolls_cd
-        self.set_next_run(task='Exploration', success=False, finish=False, target=next_run)
-        self.set_next_run(task='RealmRaid', success=False, finish=False, target=datetime.now())
-        self.set_next_run(task='MemoryScrolls', success=False, finish=False, target=datetime.now())
+        self.set_next_run(task='Exploration', success=None, finish=False, target=next_run)
+        self.set_next_run(task='RealmRaid', success=None, finish=False, target=datetime.now())
+        self.set_next_run(task='MemoryScrolls', success=None, finish=False, target=datetime.now())
         raise TaskEnd
         raise TaskEnd
 
 
     #
     #
@@ -360,7 +360,7 @@ class BaseExploration(GameUi, GeneralBattle, GeneralRoom, GeneralInvite, Replace
                 continue
                 continue
             if self.appear(self.I_EXPLORATION_TITLE) or self.appear(self.I_CHECK_EXPLORATION):
             if self.appear(self.I_EXPLORATION_TITLE) or self.appear(self.I_CHECK_EXPLORATION):
                 continue
                 continue
-            if self.appear_then_click(self.I_UI_BACK_BLUE, interval=3.5):
+            if self.appear_then_click(self.I_UI_BACK_YELLOW, interval=3.5):
                 continue
                 continue
 
 
     def fire(self, button) -> bool:
     def fire(self, button) -> bool:

+ 8 - 8
tasks/GameUi/assets.py

@@ -46,25 +46,25 @@ class GameUiAssets:
 	# description 
 	# description 
 	I_CHECK_EXPLORATION = RuleImage(roi_front=(1146,175,21,22), roi_back=(1146,175,21,22), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_exploration.png")
 	I_CHECK_EXPLORATION = RuleImage(roi_front=(1146,175,21,22), roi_back=(1146,175,21,22), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_exploration.png")
 	# 探索前往觉醒 
 	# 探索前往觉醒 
-	I_EXPLORATION_GOTO_AWAKE_ZONE = RuleImage(roi_front=(57,628,57,61), roi_back=(33,619,113,79), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_awake_zone.png")
+	I_EXPLORATION_GOTO_AWAKE_ZONE = RuleImage(roi_front=(57,628,57,42), roi_back=(33,619,113,79), threshold=0.65, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_awake_zone.png")
 	# 探索前往御魂 
 	# 探索前往御魂 
 	I_EXPLORATION_GOTO_SOUL_ZONE = RuleImage(roi_front=(159,633,55,55), roi_back=(138,620,89,75), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_soul_zone.png")
 	I_EXPLORATION_GOTO_SOUL_ZONE = RuleImage(roi_front=(159,633,55,55), roi_back=(138,620,89,75), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_soul_zone.png")
 	# 探索前往结界突破 
 	# 探索前往结界突破 
-	I_EXPLORATION_GOTO_REALM_RAID = RuleImage(roi_front=(248,636,67,48), roi_back=(229,612,203,87), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_realm_raid.png")
+	I_EXPLORATION_GOTO_REALM_RAID = RuleImage(roi_front=(248,636,67,48), roi_back=(229,612,203,87), threshold=0.65, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_realm_raid.png")
 	# 探索前往御灵 
 	# 探索前往御灵 
 	I_EXPLORATION_GOTO_GORYOU_REALM = RuleImage(roi_front=(353,639,47,45), roi_back=(346,626,178,67), threshold=0.7, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_goryou_realm.png")
 	I_EXPLORATION_GOTO_GORYOU_REALM = RuleImage(roi_front=(353,639,47,45), roi_back=(346,626,178,67), threshold=0.7, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_goryou_realm.png")
 	# 探索前往式神委派 
 	# 探索前往式神委派 
-	I_EXPLORATION_GOTO_DELEGATION = RuleImage(roi_front=(445,638,60,50), roi_back=(445,638,180,50), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_delegation.png")
+	I_EXPLORATION_GOTO_DELEGATION = RuleImage(roi_front=(453,639,53,37), roi_back=(409,613,167,75), threshold=0.65, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_delegation.png")
 	# 探索前往秘闻 
 	# 探索前往秘闻 
-	I_EXPLORATION_GOTO_SECRET_ZONES = RuleImage(roi_front=(546,628,61,55), roi_back=(524,614,200,87), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_secret_zones.png")
+	I_EXPLORATION_GOTO_SECRET_ZONES = RuleImage(roi_front=(549,633,53,40), roi_back=(524,614,200,87), threshold=0.7, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_secret_zones.png")
 	# 探索前往地域鬼王 
 	# 探索前往地域鬼王 
-	I_EXPLORATION_GOTO_AREA_BOSS = RuleImage(roi_front=(640,638,51,45), roi_back=(640,638,180,45), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_area_boss.png")
+	I_EXPLORATION_GOTO_AREA_BOSS = RuleImage(roi_front=(640,638,51,45), roi_back=(640,638,180,45), threshold=0.65, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_area_boss.png")
 	# 探索前往平安奇谭 
 	# 探索前往平安奇谭 
 	I_EXPLORATION_GOTO_HEIAN_KITAN = RuleImage(roi_front=(739,643,52,44), roi_back=(739,643,180,44), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_heian_kitan.png")
 	I_EXPLORATION_GOTO_HEIAN_KITAN = RuleImage(roi_front=(739,643,52,44), roi_back=(739,643,180,44), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_heian_kitan.png")
 	# 探索前往六道之门 
 	# 探索前往六道之门 
-	I_EXPLORATION_GOTO_SIX_GATES = RuleImage(roi_front=(938,640,60,49), roi_back=(918,631,200,66), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_six_gates.png")
+	I_EXPLORATION_GOTO_SIX_GATES = RuleImage(roi_front=(938,640,60,49), roi_back=(918,631,200,66), threshold=0.65, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_six_gates.png")
 	# 探索前往契灵之境 
 	# 探索前往契灵之境 
-	I_EXPLORATION_GOTO_BONDLING_FAIRYLAND = RuleImage(roi_front=(1037,639,56,49), roi_back=(1018,633,203,64), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_bondling_fairyland.png")
+	I_EXPLORATION_GOTO_BONDLING_FAIRYLAND = RuleImage(roi_front=(1037,635,56,44), roi_back=(918,623,218,72), threshold=0.65, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_bondling_fairyland.png")
 	# description 
 	# description 
 	I_BACK_BLUE = RuleImage(roi_front=(32,37,54,52), roi_back=(3,2,130,114), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_back_blue.png")
 	I_BACK_BLUE = RuleImage(roi_front=(32,37,54,52), roi_back=(3,2,130,114), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_back_blue.png")
 	# description 
 	# description 
@@ -148,7 +148,7 @@ class GameUiAssets:
 	# description 
 	# description 
 	I_MAIN_GOTO_MALL = RuleImage(roi_front=(663,661,41,22), roi_back=(644,613,81,78), threshold=0.7, method="Template matching", file="./tasks/GameUi/page/page_main_goto_mall.png")
 	I_MAIN_GOTO_MALL = RuleImage(roi_front=(663,661,41,22), roi_back=(644,613,81,78), threshold=0.7, method="Template matching", file="./tasks/GameUi/page/page_main_goto_mall.png")
 	# description 
 	# description 
-	I_MAIN_GOTO_GUILD = RuleImage(roi_front=(540,611,50,54), roi_back=(540,611,50,54), threshold=0.7, method="Template matching", file="./tasks/GameUi/page/page_main_goto_guild.png")
+	I_MAIN_GOTO_GUILD = RuleImage(roi_front=(544,611,50,47), roi_back=(520,583,99,105), threshold=0.7, method="Template matching", file="./tasks/GameUi/page/page_main_goto_guild.png")
 	# description 
 	# description 
 	I_MAIN_GOTO_TEAM = RuleImage(roi_front=(437,625,38,48), roi_back=(366,606,192,83), threshold=0.7, method="Template matching", file="./tasks/GameUi/page/page_main_goto_team.png")
 	I_MAIN_GOTO_TEAM = RuleImage(roi_front=(437,625,38,48), roi_back=(366,606,192,83), threshold=0.7, method="Template matching", file="./tasks/GameUi/page/page_main_goto_team.png")
 	# description 
 	# description 

+ 9 - 9
tasks/GameUi/page.py

@@ -60,7 +60,7 @@ page_summon.link(button=G.I_SUMMON_GOTO_MAIN, destination=page_main)
 page_main.link(button=G.I_MAIN_GOTO_SUMMON, destination=page_summon)
 page_main.link(button=G.I_MAIN_GOTO_SUMMON, destination=page_summon)
 # 探索exploration
 # 探索exploration
 page_exploration = Page(G.I_CHECK_EXPLORATION)
 page_exploration = Page(G.I_CHECK_EXPLORATION)
-page_exploration.link(button=G.I_BACK_BLUE, destination=page_main)
+page_exploration.link(button=G.I_BACK_YOLLOW, destination=page_main)
 page_main.link(button=G.I_MAIN_GOTO_EXPLORATION, destination=page_exploration)
 page_main.link(button=G.I_MAIN_GOTO_EXPLORATION, destination=page_exploration)
 # 町中town
 # 町中town
 page_town = Page(G.I_CHECK_TOWN)
 page_town = Page(G.I_CHECK_TOWN)
@@ -70,11 +70,11 @@ page_main.link(button=G.I_MAIN_GOTO_TOWN, destination=page_town)
 # ************************************* 探索部分 *****************************************#
 # ************************************* 探索部分 *****************************************#
 # 觉醒 awake zones
 # 觉醒 awake zones
 page_awake_zones = Page(G.I_CHECK_AWAKE)
 page_awake_zones = Page(G.I_CHECK_AWAKE)
-page_awake_zones.link(button=G.I_BACK_BLUE, destination=page_exploration)
+page_awake_zones.link(button=G.I_BACK_YOLLOW, destination=page_exploration)
 page_exploration.link(button=G.I_EXPLORATION_GOTO_AWAKE_ZONE, destination=page_awake_zones)
 page_exploration.link(button=G.I_EXPLORATION_GOTO_AWAKE_ZONE, destination=page_awake_zones)
 # 御魂 soul zones
 # 御魂 soul zones
 page_soul_zones = Page(G.I_CHECK_SOUL_ZONES)
 page_soul_zones = Page(G.I_CHECK_SOUL_ZONES)
-page_soul_zones.link(button=G.I_BACK_BLUE, destination=page_exploration)
+page_soul_zones.link(button=G.I_BACK_YOLLOW, destination=page_exploration)
 page_exploration.link(button=G.I_EXPLORATION_GOTO_SOUL_ZONE, destination=page_soul_zones)
 page_exploration.link(button=G.I_EXPLORATION_GOTO_SOUL_ZONE, destination=page_soul_zones)
 # 结界突破 realm raid
 # 结界突破 realm raid
 page_realm_raid = Page(G.I_CHECK_REALM_RAID)
 page_realm_raid = Page(G.I_CHECK_REALM_RAID)
@@ -87,19 +87,19 @@ page_realm_raid.link(button=RyouToppaAssets.I_RYOU_TOPPA, destination=page_kekka
 page_kekkai_toppa.link(button=G.I_RYOUTOPPA_GOTO_REALMRAID, destination=page_realm_raid)
 page_kekkai_toppa.link(button=G.I_RYOUTOPPA_GOTO_REALMRAID, destination=page_realm_raid)
 # 御灵 goryou realm
 # 御灵 goryou realm
 page_goryou_realm = Page(G.I_CHECK_GORYOU)
 page_goryou_realm = Page(G.I_CHECK_GORYOU)
-page_goryou_realm.link(button=G.I_BACK_BLUE, destination=page_exploration)
+page_goryou_realm.link(button=G.I_BACK_YOLLOW, destination=page_exploration)
 page_exploration.link(button=G.I_EXPLORATION_GOTO_GORYOU_REALM, destination=page_goryou_realm)
 page_exploration.link(button=G.I_EXPLORATION_GOTO_GORYOU_REALM, destination=page_goryou_realm)
 # 委派 delegation
 # 委派 delegation
 page_delegation = Page(G.I_CHECK_DELEGATION)
 page_delegation = Page(G.I_CHECK_DELEGATION)
-page_delegation.link(button=G.I_BACK_BLUE, destination=page_exploration)
+page_delegation.link(button=G.I_BACK_YOLLOW, destination=page_exploration)
 page_exploration.link(button=G.I_EXPLORATION_GOTO_DELEGATION, destination=page_delegation)
 page_exploration.link(button=G.I_EXPLORATION_GOTO_DELEGATION, destination=page_delegation)
 # 秘闻副本 SECRET zones
 # 秘闻副本 SECRET zones
 page_secret_zones = Page(G.I_CHECK_SECRET_ZONES)
 page_secret_zones = Page(G.I_CHECK_SECRET_ZONES)
-page_secret_zones.link(button=G.I_BACK_BLUE, destination=page_exploration)
+page_secret_zones.link(button=G.I_BACK_YOLLOW, destination=page_exploration)
 page_exploration.link(button=G.I_EXPLORATION_GOTO_SECRET_ZONES, destination=page_secret_zones)
 page_exploration.link(button=G.I_EXPLORATION_GOTO_SECRET_ZONES, destination=page_secret_zones)
 # 地域鬼王 area boss
 # 地域鬼王 area boss
 page_area_boss = Page(G.I_CHECK_AREA_BOSS)
 page_area_boss = Page(G.I_CHECK_AREA_BOSS)
-page_area_boss.link(button=G.I_BACK_BLUE, destination=page_exploration)
+page_area_boss.link(button=G.I_BACK_YOLLOW, destination=page_exploration)
 page_exploration.link(button=G.I_EXPLORATION_GOTO_AREA_BOSS, destination=page_area_boss)
 page_exploration.link(button=G.I_EXPLORATION_GOTO_AREA_BOSS, destination=page_area_boss)
 # 平安奇谭 heian kitan
 # 平安奇谭 heian kitan
 page_heian_kitan = Page(G.I_CHECK_HEIAN_KITAN)
 page_heian_kitan = Page(G.I_CHECK_HEIAN_KITAN)
@@ -125,7 +125,7 @@ page_demon_encounter.link(button=G.I_DEMON_ENCOUNTER_GOTO_TOWN, destination=page
 page_town.link(button=G.I_TOWN_GOTO_DEMON_ENCOUNTER, destination=page_demon_encounter)
 page_town.link(button=G.I_TOWN_GOTO_DEMON_ENCOUNTER, destination=page_demon_encounter)
 # 狩猎战 hunt
 # 狩猎战 hunt
 page_hunt = Page(G.I_CHECK_HUNT)
 page_hunt = Page(G.I_CHECK_HUNT)
-page_hunt.link(button=G.I_BACK_BL, destination=page_town)
+page_hunt.link(button=G.I_BACK_YOLLOW, destination=page_town)
 page_town.link(button=G.I_TOWN_GOTO_HUNT, destination=page_hunt)
 page_town.link(button=G.I_TOWN_GOTO_HUNT, destination=page_hunt)
 # 狩猎战麒麟 hunt_kirin
 # 狩猎战麒麟 hunt_kirin
 page_hunt_kirin = Page(G.I_CHECK_HUNT_KIRIN)
 page_hunt_kirin = Page(G.I_CHECK_HUNT_KIRIN)
@@ -168,7 +168,7 @@ from tasks.DailyTrifles.assets import DailyTriflesAssets
 # 商店 mall
 # 商店 mall
 page_mall = Page(check_button=[G.I_CHECK_MALL, DailyTriflesAssets.I_ROOM_GIFT])
 page_mall = Page(check_button=[G.I_CHECK_MALL, DailyTriflesAssets.I_ROOM_GIFT])
 page_mall.additional = [G.I_AD_CLOSE_RED, G.I_BACK_Y, G.I_DLC_CLOSE]
 page_mall.additional = [G.I_AD_CLOSE_RED, G.I_BACK_Y, G.I_DLC_CLOSE]
-page_mall.link(button=G.I_BACK_BLUE, destination=page_main)
+page_mall.link(button=G.I_BACK_YOLLOW, destination=page_main)
 page_main.link(button=G.I_MAIN_GOTO_MALL, destination=page_mall)
 page_main.link(button=G.I_MAIN_GOTO_MALL, destination=page_mall)
 # 阴阳寮 guild
 # 阴阳寮 guild
 page_guild = Page(G.I_CHECK_GUILD)
 page_guild = Page(G.I_CHECK_GUILD)

BIN
tasks/GameUi/page/page_exploration_goto_awake_zone.png


BIN
tasks/GameUi/page/page_exploration_goto_bondling_fairyland.png


BIN
tasks/GameUi/page/page_exploration_goto_delegation.png


BIN
tasks/GameUi/page/page_exploration_goto_secret_zones.png


+ 13 - 13
tasks/GameUi/page/page_img.json

@@ -38,10 +38,10 @@
   {
   {
     "itemName": "exploration_goto_awake_zone",
     "itemName": "exploration_goto_awake_zone",
     "imageName": "page_exploration_goto_awake_zone.png",
     "imageName": "page_exploration_goto_awake_zone.png",
-    "roiFront": "57,628,57,61",
+    "roiFront": "57,628,57,42",
     "roiBack": "33,619,113,79",
     "roiBack": "33,619,113,79",
     "method": "Template matching",
     "method": "Template matching",
-    "threshold": 0.8,
+    "threshold": 0.65,
     "description": "探索前往觉醒"
     "description": "探索前往觉醒"
   },
   },
   {
   {
@@ -59,7 +59,7 @@
     "roiFront": "248,636,67,48",
     "roiFront": "248,636,67,48",
     "roiBack": "229,612,203,87",
     "roiBack": "229,612,203,87",
     "method": "Template matching",
     "method": "Template matching",
-    "threshold": 0.8,
+    "threshold": 0.65,
     "description": "探索前往结界突破"
     "description": "探索前往结界突破"
   },
   },
   {
   {
@@ -74,19 +74,19 @@
   {
   {
     "itemName": "exploration_goto_delegation",
     "itemName": "exploration_goto_delegation",
     "imageName": "page_exploration_goto_delegation.png",
     "imageName": "page_exploration_goto_delegation.png",
-    "roiFront": "445,638,60,50",
-    "roiBack": "445,638,180,50",
+    "roiFront": "453,639,53,37",
+    "roiBack": "409,613,167,75",
     "method": "Template matching",
     "method": "Template matching",
-    "threshold": 0.8,
+    "threshold": 0.65,
     "description": "探索前往式神委派"
     "description": "探索前往式神委派"
   },
   },
   {
   {
     "itemName": "exploration_goto_secret_zones",
     "itemName": "exploration_goto_secret_zones",
     "imageName": "page_exploration_goto_secret_zones.png",
     "imageName": "page_exploration_goto_secret_zones.png",
-    "roiFront": "546,628,61,55",
+    "roiFront": "549,633,53,40",
     "roiBack": "524,614,200,87",
     "roiBack": "524,614,200,87",
     "method": "Template matching",
     "method": "Template matching",
-    "threshold": 0.8,
+    "threshold": 0.7,
     "description": "探索前往秘闻"
     "description": "探索前往秘闻"
   },
   },
   {
   {
@@ -95,7 +95,7 @@
     "roiFront": "640,638,51,45",
     "roiFront": "640,638,51,45",
     "roiBack": "640,638,180,45",
     "roiBack": "640,638,180,45",
     "method": "Template matching",
     "method": "Template matching",
-    "threshold": 0.8,
+    "threshold": 0.65,
     "description": "探索前往地域鬼王"
     "description": "探索前往地域鬼王"
   },
   },
   {
   {
@@ -113,16 +113,16 @@
     "roiFront": "938,640,60,49",
     "roiFront": "938,640,60,49",
     "roiBack": "918,631,200,66",
     "roiBack": "918,631,200,66",
     "method": "Template matching",
     "method": "Template matching",
-    "threshold": 0.8,
+    "threshold": 0.65,
     "description": "探索前往六道之门"
     "description": "探索前往六道之门"
   },
   },
   {
   {
     "itemName": "exploration_goto_bondling_fairyland",
     "itemName": "exploration_goto_bondling_fairyland",
     "imageName": "page_exploration_goto_bondling_fairyland.png",
     "imageName": "page_exploration_goto_bondling_fairyland.png",
-    "roiFront": "1037,639,56,49",
-    "roiBack": "1018,633,203,64",
+    "roiFront": "1037,635,56,44",
+    "roiBack": "918,623,218,72",
     "method": "Template matching",
     "method": "Template matching",
-    "threshold": 0.8,
+    "threshold": 0.65,
     "description": "探索前往契灵之境"
     "description": "探索前往契灵之境"
   },
   },
   {
   {

+ 2 - 2
tasks/GameUi/page/page_img_3.json

@@ -47,8 +47,8 @@
   {
   {
     "itemName": "main_goto_guild",
     "itemName": "main_goto_guild",
     "imageName": "page_main_goto_guild.png",
     "imageName": "page_main_goto_guild.png",
-    "roiFront": "540,611,50,54",
-    "roiBack": "540,611,50,54",
+    "roiFront": "544,611,50,47",
+    "roiBack": "520,583,99,105",
     "method": "Template matching",
     "method": "Template matching",
     "threshold": 0.7,
     "threshold": 0.7,
     "description": "description"
     "description": "description"

BIN
tasks/GameUi/page/page_main_goto_guild.png


+ 1 - 1
tasks/GoryouRealm/script_task.py

@@ -71,7 +71,7 @@ class ScriptTask(GeneralBattle, GameUi, SwitchSoul, GoryouRealmAssets):
                     break
                     break
 
 
 
 
-        self.ui_click(self.I_UI_BACK_BLUE, self.I_CHECK_EXPLORATION)
+        self.ui_click(self.I_UI_BACK_YELLOW, self.I_CHECK_EXPLORATION)
         logger.info('Back to exploration')
         logger.info('Back to exploration')
         self.set_next_run(task='GoryouRealm', success=True, finish=True)
         self.set_next_run(task='GoryouRealm', success=True, finish=True)
         raise TaskEnd
         raise TaskEnd

+ 2 - 2
tasks/KekkaiActivation/script_task.py

@@ -413,9 +413,9 @@ if __name__ == "__main__":
     from module.device.device import Device
     from module.device.device import Device
     import cv2
     import cv2
 
 
-    c = Config('switch')
+    c = Config('oas1')
     d = Device(c)
     d = Device(c)
 
 
     t = ScriptTask(c, d)
     t = ScriptTask(c, d)
-    t.check_card_num()
+    t.run()
     # t.run_activation(t.config.kekkai_activation.activation_config)
     # t.run_activation(t.config.kekkai_activation.activation_config)

+ 2 - 0
tasks/KekkaiUtilize/script_task.py

@@ -726,6 +726,8 @@ class ScriptTask(GameUi, ReplaceShikigami, KekkaiUtilizeAssets):
                 continue
                 continue
             if self.appear_then_click(self.I_UI_BACK_BLUE, interval=1):
             if self.appear_then_click(self.I_UI_BACK_BLUE, interval=1):
                 continue
                 continue
+            if self.appear_then_click(self.I_UI_BACK_YELLOW, interval=1):
+                continue
 
 
     def back_realm(self):
     def back_realm(self):
         # 回到寮结界
         # 回到寮结界

+ 1 - 1
tasks/Orochi/script_task.py

@@ -314,7 +314,7 @@ class ScriptTask(GeneralBattle, GeneralInvite, GeneralBuff, GeneralRoom, GameUi,
             self.screenshot()
             self.screenshot()
             if not self.appear(self.I_FORM_TEAM):
             if not self.appear(self.I_FORM_TEAM):
                 break
                 break
-            if self.appear_then_click(self.I_BACK_BL, interval=1):
+            if self.appear_then_click(self.I_UI_BACK_YELLOW, interval=1):
                 continue
                 continue
 
 
         self.ui_current = page_soul_zones
         self.ui_current = page_soul_zones

+ 5 - 5
tasks/RichMan/assets.py

@@ -102,7 +102,7 @@ class RichManAssets:
 	# description 
 	# description 
 	I_FS_WHITE_CLICK = RuleImage(roi_front=(627,140,138,132), roi_back=(627,140,138,132), threshold=0.8, method="Template matching", file="./tasks/RichMan/mall/friendship_points/friendship_points_fs_white_click.png")
 	I_FS_WHITE_CLICK = RuleImage(roi_front=(627,140,138,132), roi_back=(627,140,138,132), threshold=0.8, method="Template matching", file="./tasks/RichMan/mall/friendship_points/friendship_points_fs_white_click.png")
 	# 白蛋确认 
 	# 白蛋确认 
-	I_FS_WHITE_CHECK = RuleImage(roi_front=(589,227,100,100), roi_back=(589,227,100,100), threshold=0.8, method="Template matching", file="./tasks/RichMan/mall/friendship_points/friendship_points_fs_white_check.png")
+	I_FS_WHITE_CHECK = RuleImage(roi_front=(591,228,100,100), roi_back=(534,181,201,183), threshold=0.8, method="Template matching", file="./tasks/RichMan/mall/friendship_points/friendship_points_fs_white_check.png")
 
 
 
 
 	# Image Rule Assets
 	# Image Rule Assets
@@ -141,13 +141,13 @@ class RichManAssets:
 	# 破碎的咒符 
 	# 破碎的咒符 
 	I_ME_BROKEN = RuleImage(roi_front=(398,144,143,116), roi_back=(146,116,866,475), threshold=0.8, method="Template matching", file="./tasks/RichMan/mall/medal/medal_me_broken.png")
 	I_ME_BROKEN = RuleImage(roi_front=(398,144,143,116), roi_back=(146,116,866,475), threshold=0.8, method="Template matching", file="./tasks/RichMan/mall/medal/medal_me_broken.png")
 	# 购买检查 
 	# 购买检查 
-	I_ME_CHECK_BLACK = RuleImage(roi_front=(585,230,100,100), roi_back=(585,230,100,100), threshold=0.8, method="Template matching", file="./tasks/RichMan/mall/medal/medal_me_check_black.png")
+	I_ME_CHECK_BLACK = RuleImage(roi_front=(593,229,100,100), roi_back=(558,177,202,200), threshold=0.8, method="Template matching", file="./tasks/RichMan/mall/medal/medal_me_check_black.png")
 	# 购买检查 
 	# 购买检查 
-	I_ME_CHECK_BLUE = RuleImage(roi_front=(587,238,100,100), roi_back=(587,238,100,100), threshold=0.8, method="Template matching", file="./tasks/RichMan/mall/medal/medal_me_check_blue.png")
+	I_ME_CHECK_BLUE = RuleImage(roi_front=(591,220,100,100), roi_back=(541,179,206,189), threshold=0.8, method="Template matching", file="./tasks/RichMan/mall/medal/medal_me_check_blue.png")
 	# 购买检查 
 	# 购买检查 
-	I_ME_CHECK_AP = RuleImage(roi_front=(588,242,100,100), roi_back=(588,242,100,100), threshold=0.8, method="Template matching", file="./tasks/RichMan/mall/medal/medal_me_check_ap.png")
+	I_ME_CHECK_AP = RuleImage(roi_front=(590,231,100,100), roi_back=(539,194,189,162), threshold=0.8, method="Template matching", file="./tasks/RichMan/mall/medal/medal_me_check_ap.png")
 	# 购买检查 
 	# 购买检查 
-	I_ME_CHECK_SOULS = RuleImage(roi_front=(590,257,100,100), roi_back=(590,257,100,100), threshold=0.8, method="Template matching", file="./tasks/RichMan/mall/medal/medal_me_check_souls.png")
+	I_ME_CHECK_SOULS = RuleImage(roi_front=(611,225,100,100), roi_back=(507,199,272,175), threshold=0.8, method="Template matching", file="./tasks/RichMan/mall/medal/medal_me_check_souls.png")
 
 
 
 
 	# Image Rule Assets
 	# Image Rule Assets

+ 1 - 1
tasks/RichMan/mall/friendship_points.py

@@ -129,7 +129,7 @@ if __name__ == '__main__':
     from module.config.config import Config
     from module.config.config import Config
     from module.device.device import Device
     from module.device.device import Device
 
 
-    c = Config('test')
+    c = Config('oas1')
     d = Device(c)
     d = Device(c)
     t = FriendshipPoints(c, d)
     t = FriendshipPoints(c, d)
 
 

+ 2 - 2
tasks/RichMan/mall/friendship_points/image.json

@@ -29,8 +29,8 @@
   {
   {
     "itemName": "fs_white_check",
     "itemName": "fs_white_check",
     "imageName": "friendship_points_fs_white_check.png",
     "imageName": "friendship_points_fs_white_check.png",
-    "roiFront": "589,227,100,100",
-    "roiBack": "589,227,100,100",
+    "roiFront": "591,228,100,100",
+    "roiBack": "534,181,201,183",
     "method": "Template matching",
     "method": "Template matching",
     "threshold": 0.8,
     "threshold": 0.8,
     "description": "白蛋确认"
     "description": "白蛋确认"

+ 8 - 8
tasks/RichMan/mall/medal/image.json

@@ -74,8 +74,8 @@
   {
   {
     "itemName": "me_check_black",
     "itemName": "me_check_black",
     "imageName": "medal_me_check_black.png",
     "imageName": "medal_me_check_black.png",
-    "roiFront": "585,230,100,100",
-    "roiBack": "585,230,100,100",
+    "roiFront": "593,229,100,100",
+    "roiBack": "558,177,202,200",
     "method": "Template matching",
     "method": "Template matching",
     "threshold": 0.8,
     "threshold": 0.8,
     "description": "购买检查"
     "description": "购买检查"
@@ -83,8 +83,8 @@
   {
   {
     "itemName": "me_check_blue",
     "itemName": "me_check_blue",
     "imageName": "medal_me_check_blue.png",
     "imageName": "medal_me_check_blue.png",
-    "roiFront": "587,238,100,100",
-    "roiBack": "587,238,100,100",
+    "roiFront": "591,220,100,100",
+    "roiBack": "541,179,206,189",
     "method": "Template matching",
     "method": "Template matching",
     "threshold": 0.8,
     "threshold": 0.8,
     "description": "购买检查"
     "description": "购买检查"
@@ -92,8 +92,8 @@
   {
   {
     "itemName": "me_check_ap",
     "itemName": "me_check_ap",
     "imageName": "medal_me_check_ap.png",
     "imageName": "medal_me_check_ap.png",
-    "roiFront": "588,242,100,100",
-    "roiBack": "588,242,100,100",
+    "roiFront": "590,231,100,100",
+    "roiBack": "539,194,189,162",
     "method": "Template matching",
     "method": "Template matching",
     "threshold": 0.8,
     "threshold": 0.8,
     "description": "购买检查"
     "description": "购买检查"
@@ -101,8 +101,8 @@
   {
   {
     "itemName": "me_check_souls",
     "itemName": "me_check_souls",
     "imageName": "medal_me_check_souls.png",
     "imageName": "medal_me_check_souls.png",
-    "roiFront": "590,257,100,100",
-    "roiBack": "590,257,100,100",
+    "roiFront": "611,225,100,100",
+    "roiBack": "507,199,272,175",
     "method": "Template matching",
     "method": "Template matching",
     "threshold": 0.8,
     "threshold": 0.8,
     "description": "购买检查"
     "description": "购买检查"

+ 1 - 1
tasks/RyouToppa/assets.py

@@ -125,7 +125,7 @@ class RyouToppaAssets:
 	# 开始寮突按钮 
 	# 开始寮突按钮 
 	I_START_TOPPA_BUTTON = RuleImage(roi_front=(832,279,130,43), roi_back=(1,1,1055,718), threshold=0.8, method="Template matching", file="./tasks/RyouToppa/res/res_start_toppa_button.png")
 	I_START_TOPPA_BUTTON = RuleImage(roi_front=(832,279,130,43), roi_back=(1,1,1055,718), threshold=0.8, method="Template matching", file="./tasks/RyouToppa/res/res_start_toppa_button.png")
 	# 寮击破奖励 
 	# 寮击破奖励 
-	I_RYOU_REWARD = RuleImage(roi_front=(134,417,241,40), roi_back=(134,417,241,40), threshold=0.8, method="Template matching", file="./tasks/RyouToppa/res/res_ryou_reward.png")
+	I_RYOU_REWARD = RuleImage(roi_front=(134,417,241,40), roi_back=(122,390,340,84), threshold=0.65, method="Template matching", file="./tasks/RyouToppa/res/res_ryou_reward.png")
 	# 勋章奖励标题 
 	# 勋章奖励标题 
 	I_GUILD_ORDERS_REWARDS = RuleImage(roi_front=(1123,31,115,56), roi_back=(1123,31,115,56), threshold=0.8, method="Template matching", file="./tasks/RyouToppa/res/res_guild_orders_rewards.png")
 	I_GUILD_ORDERS_REWARDS = RuleImage(roi_front=(1123,31,115,56), roi_back=(1123,31,115,56), threshold=0.8, method="Template matching", file="./tasks/RyouToppa/res/res_guild_orders_rewards.png")
 	# 攻破阴阳寮 
 	# 攻破阴阳寮 

+ 2 - 2
tasks/RyouToppa/res/image.json

@@ -39,9 +39,9 @@
     "itemName": "ryou_reward",
     "itemName": "ryou_reward",
     "imageName": "res_ryou_reward.png",
     "imageName": "res_ryou_reward.png",
     "roiFront": "134,417,241,40",
     "roiFront": "134,417,241,40",
-    "roiBack": "134,417,241,40",
+    "roiBack": "122,390,340,84",
     "method": "Template matching",
     "method": "Template matching",
-    "threshold": 0.8,
+    "threshold": 0.65,
     "description": "寮击破奖励"
     "description": "寮击破奖励"
   },
   },
   {
   {

+ 1 - 1
tasks/Secret/script_task.py

@@ -128,7 +128,7 @@ class ScriptTask(GameUi, GeneralBattle, SwitchSoul, SecretAssets):
                 success = self.run_general_battle(self.battle_config)
                 success = self.run_general_battle(self.battle_config)
                 continue
                 continue
 
 
-        self.ui_click(self.I_UI_BACK_BLUE, self.I_CHECK_MAIN)
+        self.ui_click(self.I_UI_BACK_YELLOW, self.I_CHECK_MAIN)
         self.ui_get_current_page()
         self.ui_get_current_page()
         self.ui_goto(page_main)
         self.ui_goto(page_main)
         if con.secret_gold_50 or con.secret_gold_100:
         if con.secret_gold_50 or con.secret_gold_100:

+ 2 - 2
tasks/WantedQuests/script_task.py

@@ -438,7 +438,7 @@ class ScriptTask(WQExplore, SecretScriptTask, WantedQuestsAssets):
                 break
                 break
             if self.appear_then_click(self.I_UI_BACK_RED, interval=1):
             if self.appear_then_click(self.I_UI_BACK_RED, interval=1):
                 continue
                 continue
-            if self.appear_then_click(self.I_UI_BACK_BLUE, interval=1.5):
+            if self.appear_then_click(self.I_UI_BACK_YELLOW, interval=1.5):
                 continue
                 continue
         logger.info('Secret mission finished')
         logger.info('Secret mission finished')
 
 
@@ -724,7 +724,7 @@ class ScriptTask(WQExplore, SecretScriptTask, WantedQuestsAssets):
                     total = total % 10
                     total = total % 10
                 if cu > total:
                 if cu > total:
                     logger.warning('Current number of wanted quests is greater than total number')
                     logger.warning('Current number of wanted quests is greater than total number')
-                    cu = cu % 10
+                    cu = cu // 10
                 if cu == total:
                 if cu == total:
                     # 该任务已完成,一般是悬赏任务,邀请人没有做导致的
                     # 该任务已完成,一般是悬赏任务,邀请人没有做导致的
                     continue
                     continue