Bläddra i källkod

Merge upstream dev through c6c724a4 with UI and task-flow updates

Integrate 62957654..c6c724a4 (12 commits including merge commits).
Adopt Dokan creation once at finding-screen entry on each eligible run,
including refreshed scene detection after navigation; keep its retry interval.
Apply EternitySea layer/lock preparation to both leaders and members.
Adopt updated GlobalGame accept/reject/reward-icon regions and WantedQuests
invitation, tracking, destination and OCR resources, red-back navigation,
substring monster exclusions and removal of two unreferenced images.
Adopt one-batch sea-soul purchasing when game auto-selection is enabled.

The costume cache fix already existed locally with additional GIF detach,
method dispatch, mask and result-state safeguards. Resolve the conflict by
moving the complete local cache reset into upstream's RuleImage.refresh API,
preserving method copy, GIF detach and task-scoped costume isolation.
Two regression cases exposed the new auto-purchase path ignoring configured
quantity and affordability. Cap the batch by requested amount, stock and
balance, and use buy-all only when that bounded count equals remaining stock.

Retain the existing 084bae21 AreaBoss navigation fix and all local mail,
raid, exploration, cropped confirm/cancel, battle strategy, overflow,
purchase, desktop and anti-ban cleanup safeguards. Preserve all upstream
history with a normal merge; no commit was skipped wholesale.

Validation: 478 pytest cases passed (tests/ and both FrogBoss test modules),
including 12 new Dokan entry, EternitySea member and sea purchase cases.
Existing costume/GIF/mask/dispatch regression cases passed. 11 Python syntax
checks, 8 production imports, 5 JSON files, 17 PNG verifications, 46 changed
UI rules and 144 synthetic matching checks with ROI padding 0/2 passed.
Both deleted images have no remaining references; 10 sensitive local files
and cropped global confirm/cancel definitions remain unchanged.
git diff --check passed. Three dependency deprecation warnings; some upstream
PNGs emit non-fatal sBIT metadata warnings while decoding/matching succeeds.
No live emulator, desktop game or game purchase test was performed.
unknown 2 veckor sedan
förälder
incheckning
d9dfb669eb
35 ändrade filer med 280 tillägg och 193 borttagningar
  1. 15 1
      module/atom/image.py
  2. 2 12
      tasks/Component/Costume/costume_base.py
  3. 9 4
      tasks/Dokan/script_task.py
  4. 10 9
      tasks/EternitySea/script_task.py
  5. 6 6
      tasks/GlobalGame/assets.py
  6. BIN
      tasks/GlobalGame/gg/gg_g_accept.png
  7. BIN
      tasks/GlobalGame/gg/gg_g_reject.png
  8. 12 12
      tasks/GlobalGame/gg/image.json
  9. 20 8
      tasks/RichMan/mall/scales.py
  10. 40 44
      tasks/WantedQuests/assets.py
  11. 36 36
      tasks/WantedQuests/invite/image.json
  12. BIN
      tasks/WantedQuests/invite/invite_wq_invite_1.png
  13. BIN
      tasks/WantedQuests/invite/invite_wq_invite_2.png
  14. BIN
      tasks/WantedQuests/invite/invite_wq_invite_3.png
  15. 3 2
      tasks/WantedQuests/script_task.py
  16. 0 6
      tasks/WantedQuests/wq/click.json
  17. 24 33
      tasks/WantedQuests/wq/image.json
  18. 20 20
      tasks/WantedQuests/wq/ocr.json
  19. BIN
      tasks/WantedQuests/wq/wq_goto_1.png
  20. BIN
      tasks/WantedQuests/wq/wq_goto_2.png
  21. BIN
      tasks/WantedQuests/wq/wq_goto_3.png
  22. BIN
      tasks/WantedQuests/wq/wq_goto_4.png
  23. BIN
      tasks/WantedQuests/wq/wq_tarce_disenable.png
  24. BIN
      tasks/WantedQuests/wq/wq_trace_disable.png
  25. BIN
      tasks/WantedQuests/wq/wq_trace_enable.png
  26. BIN
      tasks/WantedQuests/wq/wq_trace_false.png
  27. BIN
      tasks/WantedQuests/wq/wq_trace_one_check_opened.png
  28. BIN
      tasks/WantedQuests/wq/wq_trace_one_disable.png
  29. BIN
      tasks/WantedQuests/wq/wq_trace_one_enable.png
  30. BIN
      tasks/WantedQuests/wq/wq_trace_one_realworld.png
  31. BIN
      tasks/WantedQuests/wq/wq_trace_true.png
  32. BIN
      tasks/WantedQuests/wq/wq_wq_check_task.png
  33. 38 0
      tests/tasks/Dokan/test_dokan_create.py
  34. 23 0
      tests/tasks/EternitySea/test_member_prepare.py
  35. 22 0
      tests/tasks/RichMan/test_sea_scales.py

+ 15 - 1
module/atom/image.py

@@ -8,7 +8,7 @@ from numpy import float32, int32, uint8, fromfile
 from pathlib import Path
 
 from module.atom.RuleImageMallResourceMixin import RuleImageMallResourceMixin
-from module.base.decorator import cached_property
+from module.base.decorator import cached_property, del_cached_property
 from module.logger import logger
 from module.base.utils import is_approx_rectangle
 from module.base.utils.utils import random_normal_distribution_int
@@ -233,6 +233,20 @@ class RuleImage(RuleImageMallResourceMixin):
         logger.error("match result contains nan/inf (solid-color region), treated as not matched")
         return np.nan_to_num(result, nan=-1.0, posinf=-1.0, neginf=-1.0)
 
+    def refresh(self) -> None:
+        self._image = None
+        self._kp = None
+        self._des = None
+        self._mask = None
+        self._mask_loaded = False
+        self._match_init = False
+        self.last_score = -1.0
+        self.last_scale = None
+        for cached_name in ('name', 'kp', 'des', 'is_template_match', 'is_sift_flann',
+                            'is_masked_template_match', 'is_multi_scale_template_match'):
+            del_cached_property(self, cached_name)
+
+
     def corp(self, image: np.array, roi: list = None) -> np.array:
         """
         截取图片

+ 2 - 12
tasks/Component/Costume/costume_base.py

@@ -129,18 +129,8 @@ class CostumeBase:
         asset_before_object.threshold = asset_after.threshold
         asset_before_object.method = asset_after.method
         asset_before_object.file = asset_after.file
-        # Assets are shared across tasks; discard caches from the previous costume.
-        asset_before_object._image = None
-        asset_before_object._kp = None
-        asset_before_object._des = None
-        asset_before_object._match_init = False
-        asset_before_object._mask = None
-        asset_before_object._mask_loaded = False
-        asset_before_object.last_score = -1.0
-        asset_before_object.last_scale = None
-        for name in ('name', 'kp', 'des', 'is_template_match', 'is_sift_flann',
-                     'is_masked_template_match', 'is_multi_scale_template_match'):
-            asset_before_object.__dict__.pop(name, None)
+        # https://github.com/runhey/OnmyojiAutoScript/issues/1972
+        asset_before_object.refresh()
 
     def check_costume_main(self, main_type: MainType):
         if main_type == MainType.COSTUME_MAIN:

+ 9 - 4
tasks/Dokan/script_task.py

@@ -91,6 +91,15 @@ class ScriptTask(ExtendGreenMark, GameUi, SwitchSoul, DokanSceneDetector):
         if not in_dokan:
             out_dokan_timer.start()
             self.goto_dokan_scene()
+            in_dokan, current_scene = self.get_current_scene(True)
+
+        # 进入道馆寻找界面后,在主循环前仅尝试一次开启道馆
+        if (in_dokan and
+                current_scene == DokanScene.RYOU_DOKAN_SCENE_FINDING_DOKAN and
+                cfg.dokan_config.try_start_dokan):
+            count = self.update_remain_attack_count()
+            if count > 0:
+                self.creat_dokan()
 
         # 是否已击败馆主第一阵容
         first_master_killed = False
@@ -140,10 +149,6 @@ class ScriptTask(ExtendGreenMark, GameUi, SwitchSoul, DokanSceneDetector):
                 if not try_start_dokan:
                     is_dokan_activated = False
                     break
-                # NOTE 只在周一尝试建立道馆
-                if datetime.now().weekday() == 0:
-                    self.creat_dokan()
-
                 # 寻找合适道馆,找不到直接退出
                 if not self.find_dokan(self.config.dokan.dokan_config.find_dokan_score):
                     is_dokan_activated = False

+ 10 - 9
tasks/EternitySea/script_task.py

@@ -36,6 +36,13 @@ class ScriptTask(
             self.goto_page(page_shikigami_records)
             self.run_switch_soul_by_name(config.group_name, config.team_name)
 
+    def _prepare_eternity_sea(self):
+        self.goto_page(page_soul_zones)
+        self._enter_eternity_sea()
+        layer = self._task_config.eternity_sea_config.layer
+        self.check_layer(layer)
+        self.check_lock(self._task_config.general_battle_config.lock_team_enable)
+
     def run(self) -> None:
         self._two_teams_switch_sous(self._task_config.switch_soul_config_1)
         self._two_teams_switch_sous(self._task_config.switch_soul_config_2)
@@ -55,11 +62,7 @@ class ScriptTask(
 
     def run_leader(self):
         logger.info('Start run leader')
-        self.goto_page(page_soul_zones)
-        self._enter_eternity_sea()
-        layer = self._task_config.eternity_sea_config.layer
-        self.check_layer(layer)
-        self.check_lock(self._task_config.general_battle_config.lock_team_enable)
+        self._prepare_eternity_sea()
         # 创建队伍
         logger.info('Create team')
         while 1:
@@ -177,9 +180,7 @@ class ScriptTask(
 
     def run_member(self):
         logger.info('Start run member')
-        # self.ui_goto(page_soul_zones)
-        # self.orochi_enter()
-        # self.check_lock(self.config.orochi.general_battle_config.lock_team_enable)
+        self._prepare_eternity_sea()
 
         # 进入战斗流程
         self.device.stuck_record_add('BATTLE_STATUS_S')
@@ -332,4 +333,4 @@ if __name__ == "__main__":
     c = Config("oas1")
     d = Device(c)
     t = ScriptTask(c, d)
-    t.screenshot()
+    t.screenshot()

+ 6 - 6
tasks/GlobalGame/assets.py

@@ -12,17 +12,17 @@ class GlobalGameAssets:
 
 	# Image Rule Assets
 	# 接受 
-	I_G_ACCEPT = RuleImage(roi_front=(830,407,56,46), roi_back=(798,369,117,110), threshold=0.8, method="Template matching", file="./tasks/GlobalGame/gg/gg_g_accept.png")
+	I_G_ACCEPT = RuleImage(roi_front=(846,471,56,46), roi_back=(810,448,120,192), threshold=0.8, method="Template matching", file="./tasks/GlobalGame/gg/gg_g_accept.png")
 	# 拒绝 
-	I_G_REJECT = RuleImage(roi_front=(832,508,53,51), roi_back=(808,480,108,101), threshold=0.8, method="Template matching", file="./tasks/GlobalGame/gg/gg_g_reject.png")
+	I_G_REJECT = RuleImage(roi_front=(846,561,53,51), roi_back=(826,458,99,172), threshold=0.8, method="Template matching", file="./tasks/GlobalGame/gg/gg_g_reject.png")
 	# 勾玉 
-	I_G_JADE = RuleImage(roi_front=(661,466,43,46), roi_back=(661,466,43,46), threshold=0.8, method="Template matching", file="./tasks/GlobalGame/gg/gg_g_jade.png")
+	I_G_JADE = RuleImage(roi_front=(677,510,43,46), roi_back=(549,483,202,111), threshold=0.8, method="Template matching", file="./tasks/GlobalGame/gg/gg_g_jade.png")
 	# 猫粮 
-	I_G_CAT_FOOD = RuleImage(roi_front=(565,463,59,65), roi_back=(565,463,59,65), threshold=0.8, method="Template matching", file="./tasks/GlobalGame/gg/gg_g_cat_food.png")
+	I_G_CAT_FOOD = RuleImage(roi_front=(635,501,59,65), roi_back=(558,472,191,132), threshold=0.8, method="Template matching", file="./tasks/GlobalGame/gg/gg_g_cat_food.png")
 	# 狗粮 
-	I_G_DOG_FOOD = RuleImage(roi_front=(565,464,60,63), roi_back=(565,464,60,63), threshold=0.8, method="Template matching", file="./tasks/GlobalGame/gg/gg_g_dog_food.png")
+	I_G_DOG_FOOD = RuleImage(roi_front=(643,505,60,63), roi_back=(541,485,234,115), threshold=0.8, method="Template matching", file="./tasks/GlobalGame/gg/gg_g_dog_food.png")
 	# 忽略 
-	I_G_IGNORE = RuleImage(roi_front=(773,116,21,21), roi_back=(759,102,48,48), threshold=0.8, method="Template matching", file="./tasks/GlobalGame/gg/gg_g_ignore.png")
+	I_G_IGNORE = RuleImage(roi_front=(859,94,21,21), roi_back=(725,40,197,142), threshold=0.8, method="Template matching", file="./tasks/GlobalGame/gg/gg_g_ignore.png")
 	# 网络异常 
 	I_NETWORK_ABNORMAL = RuleImage(roi_front=(583,330,221,67), roi_back=(583,330,221,67), threshold=0.8, method="Template matching", file="./tasks/GlobalGame/gg/gg_network_abnormal.png")
 	# 已端口游戏服务器,需要重新连接,这种情况一般是断开很久了 

BIN
tasks/GlobalGame/gg/gg_g_accept.png


BIN
tasks/GlobalGame/gg/gg_g_reject.png


+ 12 - 12
tasks/GlobalGame/gg/image.json

@@ -2,8 +2,8 @@
   {
     "itemName": "g_accept",
     "imageName": "gg_g_accept.png",
-    "roiFront": "830,407,56,46",
-    "roiBack": "798,369,117,110",
+    "roiFront": "846,471,56,46",
+    "roiBack": "810,448,120,192",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "接受"
@@ -11,8 +11,8 @@
   {
     "itemName": "g_reject",
     "imageName": "gg_g_reject.png",
-    "roiFront": "832,508,53,51",
-    "roiBack": "808,480,108,101",
+    "roiFront": "846,561,53,51",
+    "roiBack": "826,458,99,172",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "拒绝"
@@ -20,8 +20,8 @@
   {
     "itemName": "g_jade",
     "imageName": "gg_g_jade.png",
-    "roiFront": "661,466,43,46",
-    "roiBack": "661,466,43,46",
+    "roiFront": "677,510,43,46",
+    "roiBack": "549,483,202,111",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "勾玉"
@@ -29,8 +29,8 @@
   {
     "itemName": "g_cat_food",
     "imageName": "gg_g_cat_food.png",
-    "roiFront": "565,463,59,65",
-    "roiBack": "565,463,59,65",
+    "roiFront": "635,501,59,65",
+    "roiBack": "558,472,191,132",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "猫粮"
@@ -38,8 +38,8 @@
   {
     "itemName": "g_dog_food",
     "imageName": "gg_g_dog_food.png",
-    "roiFront": "565,464,60,63",
-    "roiBack": "565,464,60,63",
+    "roiFront": "643,505,60,63",
+    "roiBack": "541,485,234,115",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "狗粮"
@@ -47,8 +47,8 @@
   {
     "itemName": "g_ignore",
     "imageName": "gg_g_ignore.png",
-    "roiFront": "773,116,21,21",
-    "roiBack": "759,102,48,48",
+    "roiFront": "859,94,21,21",
+    "roiBack": "725,40,197,142",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "忽略"

+ 20 - 8
tasks/RichMan/mall/scales.py

@@ -314,6 +314,24 @@ class Scales(Buy, MallNavbar):
         if remain_number == 0:
             logger.warning(f'The remaining purchase quantity of xx is {remain_number}')
             return
+        # 游戏内开启自动选择御魂时,一次可以买完
+        if self.config.rich_man.scales.enable_book_auto:
+            # 检查钱是否够买一个
+            current_money = self.O_SCA_RES_SEA.ocr(self.device.image)
+            if not isinstance(current_money, int):
+                logger.warning('OCR error')
+                return
+            if current_money < 400:
+                logger.warning('Scales sea money is not enough')
+                return
+            # 自动选择只改变购买方式,仍需遵守配置数量、库存和余额。
+            number = min(buy_number, remain_number, current_money // 200)
+            if number < 1:
+                return
+            self._scales_buy_more(self.I_SCA_PICTURE_BOOK,
+                                  None if number == remain_number else number)
+            time.sleep(0.5)
+            return
         if remain_number < buy_number:
             buy_number = remain_number
             logger.warning(f'Remaining purchase quantity is {remain_number}, buy_number is {buy_number}')
@@ -340,16 +358,10 @@ class Scales(Buy, MallNavbar):
             buy_res_number = buy_number
         if buy_cycles_number:
             for i in range(buy_cycles_number):
-                if self.config.rich_man.scales.enable_book_auto:
-                    self._scales_buy_more(self.I_SCA_PICTURE_BOOK)
-                else:
-                    self._scales_buy_sea_more(self.I_SCA_PICTURE_BOOK)
+                self._scales_buy_sea_more(self.I_SCA_PICTURE_BOOK)
                 time.sleep(0.5)
         if buy_res_number and buy_res_number >= 2:
-            if self.config.rich_man.scales.enable_book_auto:
-                self._scales_buy_more(self.I_SCA_PICTURE_BOOK, buy_res_number)
-            else:
-                self._scales_buy_sea_more(self.I_SCA_PICTURE_BOOK, buy_res_number)
+            self._scales_buy_sea_more(self.I_SCA_PICTURE_BOOK, buy_res_number)
             time.sleep(0.5)
 
 

+ 40 - 44
tasks/WantedQuests/assets.py

@@ -21,11 +21,11 @@ class WantedQuestsAssets:
 
 	# Image Rule Assets
 	# description 
-	I_WQ_INVITE_1 = RuleImage(roi_front=(137,361,39,47), roi_back=(108,338,100,100), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/invite/invite_wq_invite_1.png")
+	I_WQ_INVITE_1 = RuleImage(roi_front=(103,397,37,38), roi_back=(79,366,146,104), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/invite/invite_wq_invite_1.png")
 	# description 
-	I_WQ_INVITE_2 = RuleImage(roi_front=(462,361,37,47), roi_back=(435,336,100,100), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/invite/invite_wq_invite_2.png")
+	I_WQ_INVITE_2 = RuleImage(roi_front=(386,399,31,35), roi_back=(355,368,157,108), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/invite/invite_wq_invite_2.png")
 	# description 
-	I_WQ_INVITE_3 = RuleImage(roi_front=(754,366,39,42), roi_back=(728,339,100,100), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/invite/invite_wq_invite_3.png")
+	I_WQ_INVITE_3 = RuleImage(roi_front=(671,402,37,37), roi_back=(640,368,176,105), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/invite/invite_wq_invite_3.png")
 	# description 
 	I_WQ_FRIEND_1 = RuleImage(roi_front=(240,185,180,80), roi_back=(240,185,180,80), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/invite/invite_wq_friend_1.png")
 	# description 
@@ -51,35 +51,35 @@ class WantedQuestsAssets:
 	# 邀请跨服好友,已选中状态,高亮状态 
 	I_WQ_INVITE_DIFF_SVR_HIGHLIGHT = RuleImage(roi_front=(260,70,120,90), roi_back=(260,70,120,90), threshold=0.9, method="Template matching", file="./tasks/WantedQuests/invite/wq_invite_diff_svr_highlight.png")
 	# 从左到右第一个协作任务的类型 
-	I_WQ_COOPERATION_TYPE_GOLD_1 = RuleImage(roi_front=(195,505,180,90), roi_back=(195,505,180,90), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/invite/wq_cooperation_type_gold.png")
+	I_WQ_COOPERATION_TYPE_GOLD_1 = RuleImage(roi_front=(127,527,180,90), roi_back=(127,527,180,90), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/invite/wq_cooperation_type_gold.png")
 	# 从左到右第一个协作任务的类型 
-	I_WQ_COOPERATION_TYPE_JADE_1 = RuleImage(roi_front=(195,505,180,90), roi_back=(195,505,180,90), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/invite/wq_cooperation_type_jade.png")
+	I_WQ_COOPERATION_TYPE_JADE_1 = RuleImage(roi_front=(130,527,180,90), roi_back=(130,527,180,90), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/invite/wq_cooperation_type_jade.png")
 	# 从左到右第一个协作任务的类型为狗粮 
-	I_WQ_COOPERATION_TYPE_DOG_FOOD_1 = RuleImage(roi_front=(195,505,180,90), roi_back=(195,505,180,90), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/invite/wq_cooperation_type_dog_food.png")
+	I_WQ_COOPERATION_TYPE_DOG_FOOD_1 = RuleImage(roi_front=(131,526,180,90), roi_back=(131,526,180,90), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/invite/wq_cooperation_type_dog_food.png")
 	# 从左到右第一个协作任务的类型为猫粮 
-	I_WQ_COOPERATION_TYPE_CAT_FOOD_1 = RuleImage(roi_front=(195,505,180,90), roi_back=(195,505,180,90), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/invite/wq_cooperation_type_cat_food.png")
+	I_WQ_COOPERATION_TYPE_CAT_FOOD_1 = RuleImage(roi_front=(131,525,180,90), roi_back=(131,525,180,90), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/invite/wq_cooperation_type_cat_food.png")
 	# 从左到右第一个协作任务的类型 
-	I_WQ_COOPERATION_TYPE_SUSHI_1 = RuleImage(roi_front=(195,505,180,90), roi_back=(195,505,180,90), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/invite/wq_cooperation_type_sushi.png")
+	I_WQ_COOPERATION_TYPE_SUSHI_1 = RuleImage(roi_front=(130,525,180,90), roi_back=(130,525,180,90), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/invite/wq_cooperation_type_sushi.png")
 	# 从左到右第二个协作任务的类型 
-	I_WQ_COOPERATION_TYPE_GOLD_2 = RuleImage(roi_front=(490,505,180,90), roi_back=(490,505,180,90), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/invite/wq_cooperation_type_gold.png")
+	I_WQ_COOPERATION_TYPE_GOLD_2 = RuleImage(roi_front=(412,525,180,90), roi_back=(412,525,180,90), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/invite/wq_cooperation_type_gold.png")
 	# 从左到右第二个协作任务的类型 
-	I_WQ_COOPERATION_TYPE_JADE_2 = RuleImage(roi_front=(490,505,180,90), roi_back=(490,505,180,90), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/invite/wq_cooperation_type_jade.png")
+	I_WQ_COOPERATION_TYPE_JADE_2 = RuleImage(roi_front=(413,525,180,90), roi_back=(413,525,180,90), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/invite/wq_cooperation_type_jade.png")
 	# 从左到右第二个协作任务的类型为狗粮 
-	I_WQ_COOPERATION_TYPE_DOG_FOOD_2 = RuleImage(roi_front=(490,505,180,90), roi_back=(490,505,180,90), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/invite/wq_cooperation_type_dog_food.png")
+	I_WQ_COOPERATION_TYPE_DOG_FOOD_2 = RuleImage(roi_front=(413,527,179,89), roi_back=(413,527,179,90), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/invite/wq_cooperation_type_dog_food.png")
 	# 从左到右第二个协作任务的类型为猫粮 
-	I_WQ_COOPERATION_TYPE_CAT_FOOD_2 = RuleImage(roi_front=(490,505,180,90), roi_back=(490,505,180,90), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/invite/wq_cooperation_type_cat_food.png")
+	I_WQ_COOPERATION_TYPE_CAT_FOOD_2 = RuleImage(roi_front=(412,525,180,90), roi_back=(412,525,180,90), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/invite/wq_cooperation_type_cat_food.png")
 	# 从左到右第二个协作任务的类型 
-	I_WQ_COOPERATION_TYPE_SUSHI_2 = RuleImage(roi_front=(490,505,180,90), roi_back=(490,505,180,90), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/invite/wq_cooperation_type_sushi.png")
+	I_WQ_COOPERATION_TYPE_SUSHI_2 = RuleImage(roi_front=(413,526,180,90), roi_back=(413,526,180,90), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/invite/wq_cooperation_type_sushi.png")
 	# 从左到右第三个协作任务的类型 
-	I_WQ_COOPERATION_TYPE_GOLD_3 = RuleImage(roi_front=(790,505,180,90), roi_back=(790,505,180,90), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/invite/wq_cooperation_type_gold.png")
+	I_WQ_COOPERATION_TYPE_GOLD_3 = RuleImage(roi_front=(693,524,180,90), roi_back=(693,524,180,90), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/invite/wq_cooperation_type_gold.png")
 	# 从左到右第三个协作任务的类型 
-	I_WQ_COOPERATION_TYPE_JADE_3 = RuleImage(roi_front=(790,505,180,90), roi_back=(790,505,180,90), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/invite/wq_cooperation_type_jade.png")
+	I_WQ_COOPERATION_TYPE_JADE_3 = RuleImage(roi_front=(693,527,180,90), roi_back=(693,527,180,90), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/invite/wq_cooperation_type_jade.png")
 	# 从左到右第三个协作任务的类型为狗粮 
-	I_WQ_COOPERATION_TYPE_DOG_FOOD_3 = RuleImage(roi_front=(790,505,180,90), roi_back=(790,505,180,90), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/invite/wq_cooperation_type_dog_food.png")
+	I_WQ_COOPERATION_TYPE_DOG_FOOD_3 = RuleImage(roi_front=(694,525,180,90), roi_back=(694,525,180,90), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/invite/wq_cooperation_type_dog_food.png")
 	# 从左到右第三个协作任务的类型为猫粮 
-	I_WQ_COOPERATION_TYPE_CAT_FOOD_3 = RuleImage(roi_front=(790,505,180,90), roi_back=(790,505,180,90), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/invite/wq_cooperation_type_cat_food.png")
+	I_WQ_COOPERATION_TYPE_CAT_FOOD_3 = RuleImage(roi_front=(693,526,180,90), roi_back=(693,526,180,90), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/invite/wq_cooperation_type_cat_food.png")
 	# 从左到右第三个协作任务的类型 
-	I_WQ_COOPERATION_TYPE_SUSHI_3 = RuleImage(roi_front=(790,505,180,90), roi_back=(790,505,180,90), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/invite/wq_cooperation_type_sushi.png")
+	I_WQ_COOPERATION_TYPE_SUSHI_3 = RuleImage(roi_front=(692,526,180,90), roi_back=(692,526,180,90), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/invite/wq_cooperation_type_sushi.png")
 
 
 	# Ocr Rule Assets
@@ -94,8 +94,6 @@ class WantedQuestsAssets:
 	C_SECRET_CHAT = RuleClick(roi_front=(597,296,59,100), roi_back=(597,296,59,100), name="secret_chat")
 	# 特殊的庭院需要点击,然后才能找到这个悬赏 
 	C_SPECIAL_MAIN = RuleClick(roi_front=(409,572,32,30), roi_back=(404,569,41,35), name="special_main")
-	# 关闭 单个任务追踪界面 所需点击 的  空白区域 
-	C_WQ_TRACE_ONE_CLOSE = RuleClick(roi_front=(170,30,400,100), roi_back=(170,30,400,100), name="wq_trace_one_close")
 
 
 	# Image Rule Assets
@@ -104,38 +102,36 @@ class WantedQuestsAssets:
 	# 勾号 
 	I_WQ_DONE = RuleImage(roi_front=(248,183,37,39), roi_back=(63,134,624,401), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/wq/wq_wq_done.png")
 	# 一键追踪 
-	I_TRACE_ENABLE = RuleImage(roi_front=(1097,588,101,70), roi_back=(1097,588,101,70), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/wq/wq_trace_enable.png")
+	I_TRACE_ENABLE = RuleImage(roi_front=(1159,606,52,58), roi_back=(1075,518,198,196), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/wq/wq_trace_enable.png")
 	# 取消追踪 
-	I_TRACE_DISABLE = RuleImage(roi_front=(1091,586,108,70), roi_back=(1091,586,108,70), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/wq/wq_trace_disable.png")
+	I_TRACE_DISABLE = RuleImage(roi_front=(1154,609,68,58), roi_back=(1065,495,215,225), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/wq/wq_trace_disable.png")
 	# 奖励宝箱 
 	I_WQ_BOX = RuleImage(roi_front=(48,187,43,38), roi_back=(12,78,108,496), threshold=0.7, method="Template matching", file="./tasks/WantedQuests/wq/wq_wq_box.png")
 	# 小号追踪 
-	I_TRACE_TRUE = RuleImage(roi_front=(173,187,28,29), roi_back=(173,187,28,29), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/wq/wq_trace_true.png")
+	I_TRACE_TRUE = RuleImage(roi_front=(1148,571,77,69), roi_back=(1035,502,245,213), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/wq/wq_trace_true.png")
 	# 小号不追踪 
-	I_TRACE_FALSE = RuleImage(roi_front=(170,186,31,32), roi_back=(170,186,31,32), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/wq/wq_trace_false.png")
+	I_TRACE_FALSE = RuleImage(roi_front=(1152,569,83,79), roi_back=(1051,481,229,239), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/wq/wq_trace_false.png")
 	# description 
-	I_GOTO_1 = RuleImage(roi_front=(978,234,87,45), roi_back=(978,234,87,60), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/wq/wq_goto_1.png")
+	I_GOTO_1 = RuleImage(roi_front=(1075,287,62,29), roi_back=(1054,266,99,70), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/wq/wq_goto_1.png")
 	# description 
-	I_GOTO_2 = RuleImage(roi_front=(979,305,88,43), roi_back=(979,305,88,58), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/wq/wq_goto_2.png")
+	I_GOTO_2 = RuleImage(roi_front=(1074,363,60,31), roi_back=(1055,341,99,71), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/wq/wq_goto_2.png")
 	# description 
-	I_GOTO_3 = RuleImage(roi_front=(994,396,58,30), roi_back=(979,373,88,62), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/wq/wq_goto_3.png")
+	I_GOTO_3 = RuleImage(roi_front=(1074,439,56,29), roi_back=(1053,417,101,73), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/wq/wq_goto_3.png")
 	# description 
-	I_GOTO_4 = RuleImage(roi_front=(979,447,87,42), roi_back=(979,447,87,57), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/wq/wq_goto_4.png")
-	# 判断是否还有任务 
-	I_WQ_CHECK_TASK = RuleImage(roi_front=(110,154,21,125), roi_back=(73,122,69,459), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/wq/wq_wq_check_task.png")
+	I_GOTO_4 = RuleImage(roi_front=(1078,516,55,27), roi_back=(1054,488,100,76), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/wq/wq_goto_4.png")
 	# 庭院悬赏任务界面 单个任务点开后 左上角是否追踪 
-	I_WQ_TRACE_ONE_ENABLE = RuleImage(roi_front=(160,175,120,60), roi_back=(160,175,120,60), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/wq/wq_trace_one_enable.png")
+	I_WQ_TRACE_ONE_ENABLE = RuleImage(roi_front=(1150,570,79,75), roi_back=(1047,500,233,220), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/wq/wq_trace_one_enable.png")
 	# 庭院悬赏任务界面 单个任务点开后 左上角是否追踪 
-	I_WQ_TRACE_ONE_DISABLE = RuleImage(roi_front=(160,175,120,60), roi_back=(160,175,120,60), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/wq/wq_trace_one_disable.png")
+	I_WQ_TRACE_ONE_DISABLE = RuleImage(roi_front=(1156,570,77,67), roi_back=(1055,488,225,232), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/wq/wq_trace_one_disable.png")
 	# 庭院悬赏任务界面 单个任务点开后的界面 是否打开的 标志 
-	I_WQ_TRACE_ONE_CHECK_OPENED = RuleImage(roi_front=(510,175,210,60), roi_back=(510,175,210,60), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/wq/wq_trace_one_check_opened.png")
+	I_WQ_TRACE_ONE_CHECK_OPENED = RuleImage(roi_front=(778,166,52,29), roi_back=(582,147,431,110), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/wq/wq_trace_one_check_opened.png")
 	# 庭院悬赏任务界面 单个任务点开后的界面 是否为现世任务标志 
-	I_WQ_TRACE_ONE_REALWORLD = RuleImage(roi_front=(850,470,180,180), roi_back=(850,470,180,180), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/wq/wq_trace_one_realworld.png")
+	I_WQ_TRACE_ONE_REALWORLD = RuleImage(roi_front=(1173,579,51,54), roi_back=(1037,517,243,203), threshold=0.8, method="Template matching", file="./tasks/WantedQuests/wq/wq_trace_one_realworld.png")
 
 
 	# Ocr Rule Assets
 	# 挑战券的数量 
-	O_WQ_NUMBER = RuleOcr(roi=(569,13,50,32), area=(569,13,50,32), mode="Digit", method="Default", keyword="", name="wq_number")
+	O_WQ_NUMBER = RuleOcr(roi=(541,14,97,33), area=(541,14,97,33), mode="Digit", method="Default", keyword="", name="wq_number")
 	# 悬赏封印 
 	O_WQ_WANTED = RuleOcr(roi=(15,116,85,401), area=(15,116,85,401), mode="Full", method="Default", keyword="", name="wq_wanted")
 	# Ocr-description 
@@ -151,23 +147,23 @@ class WantedQuestsAssets:
 	# 备用识别2 
 	O_WQ_NUM_UNKNOWN_2 = RuleOcr(roi=(34,406,65,24), area=(34,406,65,24), mode="Digit", method="Default", keyword="", name="wq_num_unknown_2")
 	# Ocr-description 
-	O_WQ_TYPE_1 = RuleOcr(roi=(544,248,55,36), area=(544,248,55,36), mode="Single", method="Default", keyword="", name="wq_type_1")
+	O_WQ_TYPE_1 = RuleOcr(roi=(645,283,55,36), area=(645,283,55,36), mode="Single", method="Default", keyword="", name="wq_type_1")
 	# Ocr-description 
-	O_WQ_TYPE_2 = RuleOcr(roi=(544,321,55,30), area=(544,321,55,30), mode="Single", method="Default", keyword="", name="wq_type_2")
+	O_WQ_TYPE_2 = RuleOcr(roi=(647,361,55,30), area=(647,361,55,30), mode="Single", method="Default", keyword="", name="wq_type_2")
 	# Ocr-description 
-	O_WQ_TYPE_3 = RuleOcr(roi=(544,392,54,30), area=(544,392,54,30), mode="Single", method="Default", keyword="", name="wq_type_3")
+	O_WQ_TYPE_3 = RuleOcr(roi=(648,437,54,30), area=(648,437,54,30), mode="Single", method="Default", keyword="", name="wq_type_3")
 	# Ocr-description 
-	O_WQ_TYPE_4 = RuleOcr(roi=(545,462,52,32), area=(545,462,52,32), mode="Single", method="Default", keyword="", name="wq_type_4")
+	O_WQ_TYPE_4 = RuleOcr(roi=(647,512,52,32), area=(647,512,52,32), mode="Single", method="Default", keyword="", name="wq_type_4")
 	# Ocr-description 
-	O_WQ_INFO_1 = RuleOcr(roi=(609,246,309,45), area=(609,246,309,45), mode="Single", method="Default", keyword="", name="wq_info_1")
+	O_WQ_INFO_1 = RuleOcr(roi=(710,279,309,45), area=(710,279,309,45), mode="Single", method="Default", keyword="", name="wq_info_1")
 	# Ocr-description 
-	O_WQ_INFO_2 = RuleOcr(roi=(612,318,298,41), area=(612,318,298,41), mode="Single", method="Default", keyword="", name="wq_info_2")
+	O_WQ_INFO_2 = RuleOcr(roi=(712,358,298,41), area=(712,358,298,41), mode="Single", method="Default", keyword="", name="wq_info_2")
 	# Ocr-description 
-	O_WQ_INFO_3 = RuleOcr(roi=(612,386,305,44), area=(612,386,305,44), mode="Single", method="Default", keyword="", name="wq_info_3")
+	O_WQ_INFO_3 = RuleOcr(roi=(710,430,305,44), area=(710,429,305,44), mode="Single", method="Default", keyword="", name="wq_info_3")
 	# Ocr-description 
-	O_WQ_INFO_4 = RuleOcr(roi=(613,456,315,44), area=(613,456,315,44), mode="Single", method="Default", keyword="", name="wq_info_4")
+	O_WQ_INFO_4 = RuleOcr(roi=(711,506,315,44), area=(711,507,315,44), mode="Single", method="Default", keyword="", name="wq_info_4")
 	# 怪物名称,如酒吞,阎魔等 
-	O_WQ_MONSTER_TYPE = RuleOcr(roi=(165,215,45,175), area=(165,215,45,175), mode="Full", method="Default", keyword="", name="wq_monster_type")
+	O_WQ_MONSTER_TYPE = RuleOcr(roi=(634,154,483,52), area=(634,154,483,52), mode="Full", method="Default", keyword="", name="wq_monster_type")
 	#  
 	O_WQ_TEXT_ALL = RuleOcr(roi=(12,119,88,393), area=(12,119,88,393), mode="Full", method="Default", keyword="", name="wq_text_all")
 

+ 36 - 36
tasks/WantedQuests/invite/image.json

@@ -2,8 +2,8 @@
   {
     "itemName": "wq_invite_1",
     "imageName": "invite_wq_invite_1.png",
-    "roiFront": "137,361,39,47",
-    "roiBack": "108,338,100,100",
+    "roiFront": "103,397,37,38",
+    "roiBack": "79,366,146,104",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "description"
@@ -11,8 +11,8 @@
   {
     "itemName": "wq_invite_2",
     "imageName": "invite_wq_invite_2.png",
-    "roiFront": "462,361,37,47",
-    "roiBack": "435,336,100,100",
+    "roiFront": "386,399,31,35",
+    "roiBack": "355,368,157,108",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "description"
@@ -20,8 +20,8 @@
   {
     "itemName": "wq_invite_3",
     "imageName": "invite_wq_invite_3.png",
-    "roiFront": "754,366,39,42",
-    "roiBack": "728,339,100,100",
+    "roiFront": "671,402,37,37",
+    "roiBack": "640,368,176,105",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "description"
@@ -137,8 +137,8 @@
   {
     "itemName": "wq_cooperation_type_gold_1",
     "imageName": "wq_cooperation_type_gold.png",
-    "roiFront": "195,505,180,90",
-    "roiBack": "195,505,180,90",
+    "roiFront": "127,527,180,90",
+    "roiBack": "127,527,180,90",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "从左到右第一个协作任务的类型"
@@ -146,8 +146,8 @@
   {
     "itemName": "wq_cooperation_type_jade_1",
     "imageName": "wq_cooperation_type_jade.png",
-    "roiFront": "195,505,180,90",
-    "roiBack": "195,505,180,90",
+    "roiFront": "130,527,180,90",
+    "roiBack": "130,527,180,90",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "从左到右第一个协作任务的类型"
@@ -155,8 +155,8 @@
   {
     "itemName": "wq_cooperation_type_dog_food_1",
     "imageName": "wq_cooperation_type_dog_food.png",
-    "roiFront": "195,505,180,90",
-    "roiBack": "195,505,180,90",
+    "roiFront": "131,526,180,90",
+    "roiBack": "131,526,180,90",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "从左到右第一个协作任务的类型为狗粮"
@@ -164,8 +164,8 @@
   {
     "itemName": "wq_cooperation_type_cat_food_1",
     "imageName": "wq_cooperation_type_cat_food.png",
-    "roiFront": "195,505,180,90",
-    "roiBack": "195,505,180,90",
+    "roiFront": "131,525,180,90",
+    "roiBack": "131,525,180,90",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "从左到右第一个协作任务的类型为猫粮"
@@ -173,8 +173,8 @@
   {
     "itemName": "wq_cooperation_type_sushi_1",
     "imageName": "wq_cooperation_type_sushi.png",
-    "roiFront": "195,505,180,90",
-    "roiBack": "195,505,180,90",
+    "roiFront": "130,525,180,90",
+    "roiBack": "130,525,180,90",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "从左到右第一个协作任务的类型"
@@ -182,8 +182,8 @@
   {
     "itemName": "wq_cooperation_type_gold_2",
     "imageName": "wq_cooperation_type_gold.png",
-    "roiFront": "490,505,180,90",
-    "roiBack": "490,505,180,90",
+    "roiFront": "412,525,180,90",
+    "roiBack": "412,525,180,90",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "从左到右第二个协作任务的类型"
@@ -191,8 +191,8 @@
   {
     "itemName": "wq_cooperation_type_jade_2",
     "imageName": "wq_cooperation_type_jade.png",
-    "roiFront": "490,505,180,90",
-    "roiBack": "490,505,180,90",
+    "roiFront": "413,525,180,90",
+    "roiBack": "413,525,180,90",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "从左到右第二个协作任务的类型"
@@ -200,8 +200,8 @@
   {
     "itemName": "wq_cooperation_type_dog_food_2",
     "imageName": "wq_cooperation_type_dog_food.png",
-    "roiFront": "490,505,180,90",
-    "roiBack": "490,505,180,90",
+    "roiFront": "413,527,179,89",
+    "roiBack": "413,527,179,90",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "从左到右第二个协作任务的类型为狗粮"
@@ -209,8 +209,8 @@
   {
     "itemName": "wq_cooperation_type_cat_food_2",
     "imageName": "wq_cooperation_type_cat_food.png",
-    "roiFront": "490,505,180,90",
-    "roiBack": "490,505,180,90",
+    "roiFront": "412,525,180,90",
+    "roiBack": "412,525,180,90",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "从左到右第二个协作任务的类型为猫粮"
@@ -218,8 +218,8 @@
   {
     "itemName": "wq_cooperation_type_sushi_2",
     "imageName": "wq_cooperation_type_sushi.png",
-    "roiFront": "490,505,180,90",
-    "roiBack": "490,505,180,90",
+    "roiFront": "413,526,180,90",
+    "roiBack": "413,526,180,90",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "从左到右第二个协作任务的类型"
@@ -227,8 +227,8 @@
   {
     "itemName": "wq_cooperation_type_gold_3",
     "imageName": "wq_cooperation_type_gold.png",
-    "roiFront": "790,505,180,90",
-    "roiBack": "790,505,180,90",
+    "roiFront": "693,524,180,90",
+    "roiBack": "693,524,180,90",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "从左到右第三个协作任务的类型"
@@ -236,8 +236,8 @@
   {
     "itemName": "wq_cooperation_type_jade_3",
     "imageName": "wq_cooperation_type_jade.png",
-    "roiFront": "790,505,180,90",
-    "roiBack": "790,505,180,90",
+    "roiFront": "693,527,180,90",
+    "roiBack": "693,527,180,90",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "从左到右第三个协作任务的类型"
@@ -245,8 +245,8 @@
   {
     "itemName": "wq_cooperation_type_dog_food_3",
     "imageName": "wq_cooperation_type_dog_food.png",
-    "roiFront": "790,505,180,90",
-    "roiBack": "790,505,180,90",
+    "roiFront": "694,525,180,90",
+    "roiBack": "694,525,180,90",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "从左到右第三个协作任务的类型为狗粮"
@@ -254,8 +254,8 @@
   {
     "itemName": "wq_cooperation_type_cat_food_3",
     "imageName": "wq_cooperation_type_cat_food.png",
-    "roiFront": "790,505,180,90",
-    "roiBack": "790,505,180,90",
+    "roiFront": "693,526,180,90",
+    "roiBack": "693,526,180,90",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "从左到右第三个协作任务的类型为猫粮"
@@ -263,8 +263,8 @@
   {
     "itemName": "wq_cooperation_type_sushi_3",
     "imageName": "wq_cooperation_type_sushi.png",
-    "roiFront": "790,505,180,90",
-    "roiBack": "790,505,180,90",
+    "roiFront": "692,526,180,90",
+    "roiBack": "692,526,180,90",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "从左到右第三个协作任务的类型"

BIN
tasks/WantedQuests/invite/invite_wq_invite_1.png


BIN
tasks/WantedQuests/invite/invite_wq_invite_2.png


BIN
tasks/WantedQuests/invite/invite_wq_invite_3.png


+ 3 - 2
tasks/WantedQuests/script_task.py

@@ -225,7 +225,7 @@ class ScriptTask(WQExplore, SecretScriptTask, WantedQuestsAssets):
             # 防止点击后界面来不及刷新
             sleep(1.5)
         # 关闭单个任务的追踪界面
-        self.ui_click_until_smt_disappear(self.C_WQ_TRACE_ONE_CLOSE, stop=self.I_WQ_TRACE_ONE_CHECK_OPENED,
+        self.ui_click_until_smt_disappear(self.I_UI_BACK_RED, stop=self.I_WQ_TRACE_ONE_CHECK_OPENED,
                                           interval=1.5)
 
     def execute_mission(self, ocr, num_want: int, num_challenge: int):
@@ -308,7 +308,8 @@ class ScriptTask(WQExplore, SecretScriptTask, WantedQuestsAssets):
             return False
         # 跳过不想打的
         monster_name = self.O_WQ_MONSTER_TYPE.detect_text(self.device.image)
-        if monster_name in self.unwanted_boss_name_list:
+        # 识别串可能带前缀动词(如需要击败/击杀), 用子串包含匹配而非整串相等
+        if any(name in monster_name for name in self.unwanted_boss_name_list):
             #
             logger.warning(f'unwanted {monster_name}')
             self.ui_click(self.I_TRACE_TRUE, self.I_TRACE_FALSE)

+ 0 - 6
tasks/WantedQuests/wq/click.json

@@ -10,11 +10,5 @@
     "roiFront": "409,572,32,30",
     "roiBack": "404,569,41,35",
     "description": "特殊的庭院需要点击,然后才能找到这个悬赏"
-  },
-  {
-    "itemName": "wq_trace_one_close",
-    "roiFront": "170,30,400,100",
-    "roiBack": "170,30,400,100",
-    "description": "关闭 单个任务追踪界面 所需点击 的  空白区域"
   }
 ]

+ 24 - 33
tasks/WantedQuests/wq/image.json

@@ -20,8 +20,8 @@
   {
     "itemName": "trace_enable",
     "imageName": "wq_trace_enable.png",
-    "roiFront": "1097,588,101,70",
-    "roiBack": "1097,588,101,70",
+    "roiFront": "1159,606,52,58",
+    "roiBack": "1075,518,198,196",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "一键追踪"
@@ -29,8 +29,8 @@
   {
     "itemName": "trace_disable",
     "imageName": "wq_trace_disable.png",
-    "roiFront": "1091,586,108,70",
-    "roiBack": "1091,586,108,70",
+    "roiFront": "1154,609,68,58",
+    "roiBack": "1065,495,215,225",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "取消追踪"
@@ -47,8 +47,8 @@
   {
     "itemName": "trace_true",
     "imageName": "wq_trace_true.png",
-    "roiFront": "173,187,28,29",
-    "roiBack": "173,187,28,29",
+    "roiFront": "1148,571,77,69",
+    "roiBack": "1035,502,245,213",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "小号追踪"
@@ -56,8 +56,8 @@
   {
     "itemName": "trace_false",
     "imageName": "wq_trace_false.png",
-    "roiFront": "170,186,31,32",
-    "roiBack": "170,186,31,32",
+    "roiFront": "1152,569,83,79",
+    "roiBack": "1051,481,229,239",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "小号不追踪"
@@ -65,8 +65,8 @@
   {
     "itemName": "goto_1",
     "imageName": "wq_goto_1.png",
-    "roiFront": "978,234,87,45",
-    "roiBack": "978,234,87,60",
+    "roiFront": "1075,287,62,29",
+    "roiBack": "1054,266,99,70",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "description"
@@ -74,8 +74,8 @@
   {
     "itemName": "goto_2",
     "imageName": "wq_goto_2.png",
-    "roiFront": "979,305,88,43",
-    "roiBack": "979,305,88,58",
+    "roiFront": "1074,363,60,31",
+    "roiBack": "1055,341,99,71",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "description"
@@ -83,8 +83,8 @@
   {
     "itemName": "goto_3",
     "imageName": "wq_goto_3.png",
-    "roiFront": "994,396,58,30",
-    "roiBack": "979,373,88,62",
+    "roiFront": "1074,439,56,29",
+    "roiBack": "1053,417,101,73",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "description"
@@ -92,26 +92,17 @@
   {
     "itemName": "goto_4",
     "imageName": "wq_goto_4.png",
-    "roiFront": "979,447,87,42",
-    "roiBack": "979,447,87,57",
+    "roiFront": "1078,516,55,27",
+    "roiBack": "1054,488,100,76",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "description"
   },
-  {
-    "itemName": "wq_check_task",
-    "imageName": "wq_wq_check_task.png",
-    "roiFront": "110,154,21,125",
-    "roiBack": "73,122,69,459",
-    "method": "Template matching",
-    "threshold": 0.8,
-    "description": "判断是否还有任务"
-  },
   {
     "itemName": "wq_trace_one_enable",
     "imageName": "wq_trace_one_enable.png",
-    "roiFront": "160,175,120,60",
-    "roiBack": "160,175,120,60",
+    "roiFront": "1150,570,79,75",
+    "roiBack": "1047,500,233,220",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "庭院悬赏任务界面 单个任务点开后 左上角是否追踪"
@@ -119,8 +110,8 @@
   {
     "itemName": "wq_trace_one_disable",
     "imageName": "wq_trace_one_disable.png",
-    "roiFront": "160,175,120,60",
-    "roiBack": "160,175,120,60",
+    "roiFront": "1156,570,77,67",
+    "roiBack": "1055,488,225,232",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "庭院悬赏任务界面 单个任务点开后 左上角是否追踪"
@@ -128,8 +119,8 @@
   {
     "itemName": "wq_trace_one_check_opened",
     "imageName": "wq_trace_one_check_opened.png",
-    "roiFront": "510,175,210,60",
-    "roiBack": "510,175,210,60",
+    "roiFront": "778,166,52,29",
+    "roiBack": "582,147,431,110",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "庭院悬赏任务界面 单个任务点开后的界面 是否打开的 标志"
@@ -137,8 +128,8 @@
   {
     "itemName": "wq_trace_one_realworld",
     "imageName": "wq_trace_one_realworld.png",
-    "roiFront": "850,470,180,180",
-    "roiBack": "850,470,180,180",
+    "roiFront": "1173,579,51,54",
+    "roiBack": "1037,517,243,203",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "庭院悬赏任务界面 单个任务点开后的界面 是否为现世任务标志"

+ 20 - 20
tasks/WantedQuests/wq/ocr.json

@@ -1,8 +1,8 @@
 [
   {
     "itemName": "wq_number",
-    "roiFront": "569,13,50,32",
-    "roiBack": "569,13,50,32",
+    "roiFront": "541,14,97,33",
+    "roiBack": "541,14,97,33",
     "mode": "Digit",
     "method": "Default",
     "keyword": "",
@@ -73,8 +73,8 @@
   },
   {
     "itemName": "wq_type_1",
-    "roiFront": "544,248,55,36",
-    "roiBack": "544,248,55,36",
+    "roiFront": "645,283,55,36",
+    "roiBack": "645,283,55,36",
     "mode": "Single",
     "method": "Default",
     "keyword": "",
@@ -82,8 +82,8 @@
   },
   {
     "itemName": "wq_type_2",
-    "roiFront": "544,321,55,30",
-    "roiBack": "544,321,55,30",
+    "roiFront": "647,361,55,30",
+    "roiBack": "647,361,55,30",
     "mode": "Single",
     "method": "Default",
     "keyword": "",
@@ -91,8 +91,8 @@
   },
   {
     "itemName": "wq_type_3",
-    "roiFront": "544,392,54,30",
-    "roiBack": "544,392,54,30",
+    "roiFront": "648,437,54,30",
+    "roiBack": "648,437,54,30",
     "mode": "Single",
     "method": "Default",
     "keyword": "",
@@ -100,8 +100,8 @@
   },
   {
     "itemName": "wq_type_4",
-    "roiFront": "545,462,52,32",
-    "roiBack": "545,462,52,32",
+    "roiFront": "647,512,52,32",
+    "roiBack": "647,512,52,32",
     "mode": "Single",
     "method": "Default",
     "keyword": "",
@@ -109,8 +109,8 @@
   },
   {
     "itemName": "wq_info_1",
-    "roiFront": "609,246,309,45",
-    "roiBack": "609,246,309,45",
+    "roiFront": "710,279,309,45",
+    "roiBack": "710,279,309,45",
     "mode": "Single",
     "method": "Default",
     "keyword": "",
@@ -118,8 +118,8 @@
   },
   {
     "itemName": "wq_info_2",
-    "roiFront": "612,318,298,41",
-    "roiBack": "612,318,298,41",
+    "roiFront": "712,358,298,41",
+    "roiBack": "712,358,298,41",
     "mode": "Single",
     "method": "Default",
     "keyword": "",
@@ -127,8 +127,8 @@
   },
   {
     "itemName": "wq_info_3",
-    "roiFront": "612,386,305,44",
-    "roiBack": "612,386,305,44",
+    "roiFront": "710,430,305,44",
+    "roiBack": "710,429,305,44",
     "mode": "Single",
     "method": "Default",
     "keyword": "",
@@ -136,8 +136,8 @@
   },
   {
     "itemName": "wq_info_4",
-    "roiFront": "613,456,315,44",
-    "roiBack": "613,456,315,44",
+    "roiFront": "711,506,315,44",
+    "roiBack": "711,507,315,44",
     "mode": "Single",
     "method": "Default",
     "keyword": "",
@@ -145,8 +145,8 @@
   },
   {
     "itemName": "wq_monster_type",
-    "roiFront": "165,215,45,175",
-    "roiBack": "165,215,45,175",
+    "roiFront": "634,154,483,52",
+    "roiBack": "634,154,483,52",
     "mode": "Full",
     "method": "Default",
     "keyword": "",

BIN
tasks/WantedQuests/wq/wq_goto_1.png


BIN
tasks/WantedQuests/wq/wq_goto_2.png


BIN
tasks/WantedQuests/wq/wq_goto_3.png


BIN
tasks/WantedQuests/wq/wq_goto_4.png


BIN
tasks/WantedQuests/wq/wq_tarce_disenable.png


BIN
tasks/WantedQuests/wq/wq_trace_disable.png


BIN
tasks/WantedQuests/wq/wq_trace_enable.png


BIN
tasks/WantedQuests/wq/wq_trace_false.png


BIN
tasks/WantedQuests/wq/wq_trace_one_check_opened.png


BIN
tasks/WantedQuests/wq/wq_trace_one_disable.png


BIN
tasks/WantedQuests/wq/wq_trace_one_enable.png


BIN
tasks/WantedQuests/wq/wq_trace_one_realworld.png


BIN
tasks/WantedQuests/wq/wq_trace_true.png


BIN
tasks/WantedQuests/wq/wq_wq_check_task.png


+ 38 - 0
tests/tasks/Dokan/test_dokan_create.py

@@ -0,0 +1,38 @@
+from types import SimpleNamespace
+import pytest
+from module.exception import TaskEnd
+from tasks.Dokan.script_task import ScriptTask, DokanScene
+
+
+@pytest.mark.parametrize('already_inside,enabled,count,creates', [
+    (True, True, 2, 1), (False, True, 2, 1),
+    (True, False, 2, 0), (True, True, 0, 0),
+])
+def test_create_once_per_entry_and_not_each_search_loop(already_inside, enabled, count, creates):
+    task = object.__new__(ScriptTask)
+    task.config = SimpleNamespace(save=lambda: None, dokan=SimpleNamespace(
+        dokan_config=SimpleNamespace(dokan_attack_priority=0, monday_to_thursday=False,
+                                    try_start_dokan=enabled, find_dokan_score=2),
+        attack_count_config=SimpleNamespace(init_attack_count=lambda **kwargs: None),
+    ))
+    events = []
+    reads = 0
+    def scene(*args):
+        nonlocal reads
+        reads += 1
+        assert reads < 10
+        return (already_inside or reads > 1, DokanScene.RYOU_DOKAN_SCENE_FINDING_DOKAN)
+    task.get_current_scene = scene
+    task.goto_dokan_scene = lambda: events.append('enter')
+    task.update_remain_attack_count = lambda: count
+    task.creat_dokan = lambda: events.append('create')
+    results = iter([True, False])
+    task.find_dokan = lambda score: next(results)
+    task.screenshot = lambda: None
+    task.wait_until_appear = lambda *args: None
+    task.goto_main = lambda: None
+    task.next_run = lambda **kwargs: None
+    with pytest.raises(TaskEnd):
+        task.run()
+    assert events.count('create') == creates
+    assert events.count('enter') == int(not already_inside)

+ 23 - 0
tests/tasks/EternitySea/test_member_prepare.py

@@ -0,0 +1,23 @@
+from types import SimpleNamespace
+import pytest
+from tasks.EternitySea.script_task import ScriptTask, page_soul_zones
+
+
+@pytest.mark.parametrize('locked', [True, False])
+def test_member_prepares_selected_layer_and_lock_before_accepting_invites(locked):
+    task = object.__new__(ScriptTask)
+    task.config = SimpleNamespace(model=SimpleNamespace(eternity_sea=SimpleNamespace(
+        eternity_sea_config=SimpleNamespace(layer=4),
+        general_battle_config=SimpleNamespace(lock_team_enable=locked))))
+    calls = []
+    task.goto_page = lambda page: calls.append(('page', page))
+    task._enter_eternity_sea = lambda: calls.append('enter')
+    task.check_layer = lambda layer: calls.append(('layer', layer))
+    task.check_lock = lambda flag: calls.append(('lock', flag))
+    class Prepared(Exception): pass
+    def battle_record(name):
+        assert calls == [('page', page_soul_zones), 'enter', ('layer', 4), ('lock', locked)]
+        raise Prepared
+    task.device = SimpleNamespace(stuck_record_add=battle_record)
+    with pytest.raises(Prepared):
+        task.run_member()

+ 22 - 0
tests/tasks/RichMan/test_sea_scales.py

@@ -0,0 +1,22 @@
+from types import SimpleNamespace
+import pytest
+from tasks.RichMan.mall import scales as module
+
+
+@pytest.mark.parametrize('requested,remaining,money,expected', [
+    (0, 30, 10000, []), (4, 30, 10000, [4]), (30, 8, 10000, [None]),
+    (30, 30, 1000, [5]), (30, 30, 399, []), (30, 0, 10000, []),
+])
+def test_auto_sea_purchase_is_one_batch_with_config_stock_and_budget_limits(monkeypatch, requested, remaining, money, expected):
+    monkeypatch.setattr(module.time, 'sleep', lambda seconds: None)
+    task = object.__new__(module.Scales)
+    task.config = SimpleNamespace(rich_man=SimpleNamespace(scales=SimpleNamespace(enable_book_auto=True)))
+    task.device = SimpleNamespace(image=None)
+    task.screenshot = lambda: None
+    task.appear = lambda asset: True
+    task.O_SCA_NUMBER_SEA = SimpleNamespace(ocr=lambda image: remaining)
+    task.O_SCA_RES_SEA = SimpleNamespace(ocr=lambda image: money)
+    calls = []
+    task._scales_buy_more = lambda asset, number=None: calls.append(number)
+    task._scales_sea(requested)
+    assert calls == expected