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

Merge pull request #842 from runhey/dev

Automated PR 2025.05.01
huangrunheng 1 год назад
Родитель
Сommit
1017a523b0

+ 7 - 1
module/atom/animate.py

@@ -47,10 +47,11 @@ class RuleAnimate(RuleImage):
     def name(self) -> str:
         return self._name.upper()
 
-    def stable(self, image) -> bool:
+    def stable(self, image, refresh_after_stable: bool = False) -> bool:
         """
         用于判断连续的两张截图,的目标区域是否一致
         @param image:
+        @param refresh_after_stable:
         @return:
         """
         if self._last_image is None:
@@ -62,10 +63,15 @@ class RuleAnimate(RuleImage):
         self._last_image = self.corp(image, self.roi_front)
 
         if matched:
+            if refresh_after_stable:
+                self.refresh()
             logger.info(f'Animation Stable @ {self.name}')
             return True
         return False
 
+    def refresh(self):
+        self._last_image = None
+
 
 if __name__ == '__main__':
     from module.base.utils import load_image

+ 6 - 2
tasks/Exploration/solo.py

@@ -80,7 +80,9 @@ class SoloExploration(BaseExploration):
                 # 向后拉,寻找怪
                 if search_fail_cnt >= 4:
                     search_fail_cnt = 0
-                    if (self._config.exploration_config.exploration_level == ExplorationLevel.EXPLORATION_28 and self.appear(self.I_SWIPE_END)) or self._match_end.stable(self.device.image):
+                    if (self._config.exploration_config.exploration_level == ExplorationLevel.EXPLORATION_28\
+                        and self.appear(self.I_SWIPE_END))\
+                            or self._match_end.stable(self.device.image, refresh_after_stable=True):
                         self.quit_explore()
                         continue
                     if self.swipe(self.S_SWIPE_BACKGROUND_RIGHT, interval=3):
@@ -210,7 +212,9 @@ class SoloExploration(BaseExploration):
                 # 向后拉,寻找怪
                 if search_fail_cnt >= 4:
                     search_fail_cnt = 0
-                    if (self._config.exploration_config.exploration_level == ExplorationLevel.EXPLORATION_28 and self.appear(self.I_SWIPE_END)) or self._match_end.stable(self.device.image):
+                    if (self._config.exploration_config.exploration_level == ExplorationLevel.EXPLORATION_28\
+                        and self.appear(self.I_SWIPE_END))\
+                            or self._match_end.stable(self.device.image, refresh_after_stable=True):
                         self.quit_explore()
                         continue
                     if self.swipe(self.S_SWIPE_BACKGROUND_RIGHT, interval=4.5):

+ 1 - 1
tasks/GameUi/assets.py

@@ -90,7 +90,7 @@ class GameUiAssets:
 
 	# Image Rule Assets
 	# description 
-	I_MAIN_GOTO_TOWN = RuleImage(roi_front=(706,249,61,57), roi_back=(200,120,951,298), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_main_goto_town.png")
+	I_MAIN_GOTO_TOWN = RuleImage(roi_front=(706,249,61,57), roi_back=(200,120,951,298), threshold=0.6, method="Template matching", file="./tasks/GameUi/page/page_main_goto_town.png")
 	# description 
 	I_CHECK_TOWN = RuleImage(roi_front=(1026,106,68,82), roi_back=(765,98,402,96), threshold=0.8, method="Template matching", file="./tasks/GameUi/page/page_check_town.png")
 	# description 

+ 1 - 1
tasks/GameUi/page/page_img_2.json

@@ -5,7 +5,7 @@
     "roiFront": "706,249,61,57",
     "roiBack": "200,120,951,298",
     "method": "Template matching",
-    "threshold": 0.8,
+    "threshold": 0.6,
     "description": "description"
   },
   {

BIN
tasks/Hyakkiyakou/hya/hya_ensure_recall.png


+ 1 - 1
tasks/WeeklyTrifles/assets.py

@@ -74,7 +74,7 @@ class WeeklyTriflesAssets:
 	# 微信 
 	I_WT_SE_WECHAT = RuleImage(roi_front=(786,627,45,37), roi_back=(786,627,45,37), threshold=0.8, method="Template matching", file="./tasks/WeeklyTrifles/secret/secret_wt_se_wechat.png")
 	# 勾玉 
-	I_WT_SE_JADE = RuleImage(roi_front=(1123,532,35,39), roi_back=(1123,532,35,39), threshold=0.8, method="Template matching", file="./tasks/WeeklyTrifles/secret/secret_wt_se_jade.png")
+	I_WT_SE_JADE = RuleImage(roi_front=(1129,527,35,39), roi_back=(1129,527,35,39), threshold=0.8, method="Template matching", file="./tasks/WeeklyTrifles/secret/secret_wt_se_jade.png")
 	# 排行 
 	I_WT_SE_RANK = RuleImage(roi_front=(1017,572,45,44), roi_back=(989,556,103,81), threshold=0.8, method="Template matching", file="./tasks/WeeklyTrifles/secret/secret_wt_se_rank.png")
 

+ 2 - 2
tasks/WeeklyTrifles/secret/image.json

@@ -29,8 +29,8 @@
   {
     "itemName": "wt_se_jade",
     "imageName": "secret_wt_se_jade.png",
-    "roiFront": "1123,532,35,39",
-    "roiBack": "1123,532,35,39",
+    "roiFront": "1129,527,35,39",
+    "roiBack": "1129,527,35,39",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "勾玉"

BIN
tasks/WeeklyTrifles/secret/secret_wt_se_jade.png