Эх сурвалжийг харах

fix(ActivityShikigami): Update image ROI

Neptine 9 сар өмнө
parent
commit
ad1ffcfa13

+ 1 - 1
tasks/Component/RightActivity/assets.py

@@ -16,6 +16,6 @@ class RightActivityAssets:
 	# description 
 	I_RA_CLOSE = RuleImage(roi_front=(1256,123,23,44), roi_back=(1256,123,23,44), threshold=0.8, method="Template matching", file="./tasks/Component/RightActivity/ra/ra_ra_close.png")
 	# description 
-	I_TOGGLE_BUTTON = RuleImage(roi_front=(1193,463,27,25), roi_back=(1169,146,73,403), threshold=0.8, method="Template matching", file="./tasks/Component/RightActivity/ra/as_toggle_button.png")
+	I_TOGGLE_BUTTON = RuleImage(roi_front=(1193,527,27,25), roi_back=(1169,146,73,453), threshold=0.8, method="Template matching", file="./tasks/Component/RightActivity/ra/as_toggle_button.png")
 
 

+ 2 - 2
tasks/Component/RightActivity/ra/image.json

@@ -20,8 +20,8 @@
   {
     "itemName": "toggle_button",
     "imageName": "as_toggle_button.png",
-    "roiFront": "1193,463,27,25",
-    "roiBack": "1169,146,73,403",
+    "roiFront": "1193,527,27,25",
+    "roiBack": "1169,146,73,453",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "description"

+ 4 - 0
tasks/RichMan/guild.py

@@ -41,6 +41,7 @@ class Guild(Buy, GameUi, RichManAssets):
             if self.swipe(self.S_GUILD_STORE, interval=1.5):
                 time.sleep(2)
                 continue
+        self.wait_until_stable(self.I_GUILD_SKIN_CHECK)
 
         # 开始购买
         if con.mystery_amulet:
@@ -111,6 +112,9 @@ class Guild(Buy, GameUi, RichManAssets):
         return True
 
     def check_remain(self, image: RuleImage) -> int:
+        if not self.appear(image):
+            logger.warning(f'Image {image.name} not appear')
+            return 0
         self.O_GUILD_REMAIN.roi[0] = image.roi_front[0] - 38
         self.O_GUILD_REMAIN.roi[1] = image.roi_front[1] + 83
         logger.info(f'Image roi {image.roi_front}')