فهرست منبع

fix(Exploration): Update

ryland 6 ماه پیش
والد
کامیت
194370999a

+ 6 - 2
tasks/Exploration/assets.py

@@ -74,7 +74,7 @@ class ExplorationAssets:
 	# 进入难度选择界面 
 	I_E_EXPLORATION_OPEN = RuleImage(roi_front=(1077,248,37,80), roi_back=(1072,242,47,92), threshold=0.8, method="Template matching", file="./tasks/Exploration/res/res_e_exploration_open.png")
 	# 探索按钮 
-	I_E_EXPLORATION_CLICK = RuleImage(roi_front=(898,518,96,42), roi_back=(898,518,96,42), threshold=0.8, method="Template matching", file="./tasks/Exploration/res/res_e_exploration_click.png")
+	I_E_EXPLORATION_CLICK = RuleImage(roi_front=(1076,601,96,42), roi_back=(939,555,307,127), threshold=0.8, method="Template matching", file="./tasks/Exploration/res/res_e_exploration_click.png")
 	# 自动轮换开着 
 	I_E_AUTO_ROTATE_ON = RuleImage(roi_front=(104,649,153,44), roi_back=(104,649,153,44), threshold=0.9, method="Template matching", file="./tasks/Exploration/res/res_e_auto_rotate_on.png")
 	# 自动轮换关闭 
@@ -119,6 +119,10 @@ class ExplorationAssets:
 	I_EXP_CREATE_TEAM = RuleImage(roi_front=(590,514,122,52), roi_back=(543,490,192,100), threshold=0.8, method="Template matching", file="./tasks/Exploration/res/res_exp_create_team.png")
 	# 创建确认 
 	I_EXP_CREATE_ENSURE = RuleImage(roi_front=(534,486,218,59), roi_back=(516,475,244,85), threshold=0.8, method="Template matching", file="./tasks/Exploration/res/res_exp_create_ensure.png")
+	# 箭头,收纳 
+	I_EXP_ARROW_RIGHT = RuleImage(roi_front=(1240,117,24,21), roi_back=(1178,74,100,100), threshold=0.8, method="Template matching", file="./tasks/Exploration/res/res_exp_arrow_right.png")
+	# 箭头,打开 
+	I_EXP_ARROW_LEFT = RuleImage(roi_front=(1244,115,18,26), roi_back=(1178,78,100,100), threshold=0.8, method="Template matching", file="./tasks/Exploration/res/res_exp_arrow_left.png")
 
 
 	# Long Click Rule Assets
@@ -134,7 +138,7 @@ class ExplorationAssets:
 
 	# Ocr Rule Assets
 	# 识别当前显示的章节 
-	O_E_EXPLORATION_LEVEL_NUMBER = RuleOcr(roi=(1079,193,147,467), area=(1079,193,147,467), mode="Full", method="Default", keyword="", name="e_exploration_level_number")
+	O_E_EXPLORATION_LEVEL_NUMBER = RuleOcr(roi=(1064,206,121,337), area=(1064,206,121,337), mode="Full", method="Default", keyword="", name="e_exploration_level_number")
 	# 候补出战的数量 
 	O_E_ALTERNATE_NUMBER = RuleOcr(roi=(1092,122,69,32), area=(1092,122,69,32), mode="DigitCounter", method="Default", keyword="", name="e_alternate_number")
 	# 探索右上角 突破卷的数量 

+ 2 - 2
tasks/Exploration/base.py

@@ -63,7 +63,7 @@ class BaseExploration(GameUi, GeneralBattle, GeneralRoom, GeneralInvite, Replace
 
         if self.appear(self.I_CHECK_EXPLORATION) and not self.appear(self.I_E_SETTINGS_BUTTON):
             return Scene.WORLD
-        elif self.appear(self.I_UI_BACK_RED) and self.appear(self.I_E_EXPLORATION_CLICK):
+        elif self.appear(self.I_E_EXPLORATION_CLICK):
             return Scene.ENTRANCE
         elif self.appear(self.I_E_SETTINGS_BUTTON) or self.appear(self.I_E_AUTO_ROTATE_ON) or self.appear(self.I_E_AUTO_ROTATE_OFF):
             return Scene.MAIN
@@ -153,7 +153,7 @@ class BaseExploration(GameUi, GeneralBattle, GeneralRoom, GeneralInvite, Replace
             swipeCount += 1
             debug_info = f"Swiped {swipeCount} times, current exploration level: {text1}"
             logger.info(debug_info)
-            if swipeCount >= 25:
+            if swipeCount >= 15:
                 raise GameStuckError(
                     f"Swiped too many times ({swipeCount}), seems stuck in exploration level selection"
                 )

+ 20 - 2
tasks/Exploration/res/image.json

@@ -11,8 +11,8 @@
   {
     "itemName": "e_exploration_click",
     "imageName": "res_e_exploration_click.png",
-    "roiFront": "898,518,96,42",
-    "roiBack": "898,518,96,42",
+    "roiFront": "1076,601,96,42",
+    "roiBack": "939,555,307,127",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "探索按钮"
@@ -214,5 +214,23 @@
     "method": "Template matching",
     "threshold": 0.8,
     "description": "创建确认"
+  },
+  {
+    "itemName": "exp_arrow_right",
+    "imageName": "res_exp_arrow_right.png",
+    "roiFront": "1240,117,24,21",
+    "roiBack": "1178,74,100,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "箭头,收纳"
+  },
+  {
+    "itemName": "exp_arrow_left",
+    "imageName": "res_exp_arrow_left.png",
+    "roiFront": "1244,115,18,26",
+    "roiBack": "1178,78,100,100",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "箭头,打开"
   }
 ]

+ 2 - 2
tasks/Exploration/res/ocr.json

@@ -1,8 +1,8 @@
 [
   {
     "itemName": "e_exploration_level_number",
-    "roiFront": "1079,193,147,467",
-    "roiBack": "1079,193,147,467",
+    "roiFront": "1064,206,121,337",
+    "roiBack": "1064,206,121,337",
     "mode": "Full",
     "method": "Default",
     "keyword": "",

BIN
tasks/Exploration/res/res_e_exploration_click.png


BIN
tasks/Exploration/res/res_exp_arrow_left.png


BIN
tasks/Exploration/res/res_exp_arrow_right.png


+ 6 - 0
tasks/Exploration/solo.py

@@ -38,6 +38,8 @@ class SoloExploration(BaseExploration):
 
             #
             if scene == Scene.WORLD:
+                # 打开右边箭头
+                self.ui_click(click=self.I_EXP_ARROW_LEFT, stop=self.I_EXP_ARROW_RIGHT, interval=2)
                 if self.appear(self.I_TREASURE_BOX_CLICK):
                     # 宝箱
                     logger.info('Treasure box appear, get it.')
@@ -107,6 +109,8 @@ class SoloExploration(BaseExploration):
             # 探索大世界
             if scene == Scene.WORLD:
                 self.wait_until_stable(self.I_CHECK_EXPLORATION)
+                # 打开右边箭头
+                self.ui_click(click=self.I_EXP_ARROW_LEFT, stop=self.I_EXP_ARROW_RIGHT, interval=2)
                 if self.appear(self.I_TREASURE_BOX_CLICK):
                     # 宝箱
                     logger.info('Treasure box appear, get it.')
@@ -238,6 +242,8 @@ class SoloExploration(BaseExploration):
             scene = self.get_current_scene()
             #
             if scene == Scene.WORLD:
+                # 打开右边箭头
+                self.ui_click(click=self.I_EXP_ARROW_LEFT, stop=self.I_EXP_ARROW_RIGHT, interval=2)
                 if self.appear(self.I_TREASURE_BOX_CLICK):
                     # 宝箱
                     logger.info('Treasure box appear, get it.')

+ 1 - 1
tasks/GameUi/assets.py

@@ -44,7 +44,7 @@ class GameUiAssets:
 	# description 
 	I_MAIN_GOTO_EXPLORATION = RuleImage(roi_front=(493,116,45,75), roi_back=(243,100,933,211), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_main_goto_exploration.png")
 	# description 
-	I_CHECK_EXPLORATION = RuleImage(roi_front=(412,46,29,28), roi_back=(376,7,91,76), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_exploration.png")
+	I_CHECK_EXPLORATION = RuleImage(roi_front=(1103,675,23,20), roi_back=(1063,643,91,76), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_exploration.png")
 	# 探索前往觉醒 
 	I_EXPLORATION_GOTO_AWAKE_ZONE = RuleImage(roi_front=(65,632,50,41), roi_back=(33,619,1125,98), threshold=0.65, method="Template matching", file="./tasks/GameUi/page/page_exploration_goto_awake_zone.png")
 	# 探索前往御魂 

BIN
tasks/GameUi/page/page_check_exploration.png


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

@@ -29,8 +29,8 @@
   {
     "itemName": "check_exploration",
     "imageName": "page_check_exploration.png",
-    "roiFront": "412,46,29,28",
-    "roiBack": "376,7,91,76",
+    "roiFront": "1103,675,23,20",
+    "roiBack": "1063,643,91,76",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "description"