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

feat(SoulsTidy): update image ROIs and add new assets for abandoned state

Migs 1 год назад
Родитель
Сommit
541f90f4ff

+ 6 - 2
tasks/SoulsTidy/assets.py

@@ -12,7 +12,7 @@ class SoulsTidyAssets:
 
 	# Click Rule Assets
 	# 御魂详细 
-	C_ST_DETAIL = RuleClick(roi_front=(1189,321,87,74), roi_back=(1189,321,87,74), name="st_detail")
+	C_ST_DETAIL = RuleClick(roi_front=(1162,230,87,74), roi_back=(1164,229,87,74), name="st_detail")
 	# 出现神赐 
 	C_ST_GOD_PRSENT = RuleClick(roi_front=(717,165,100,48), roi_back=(926,165,100,54), name="st_god_prsent")
 
@@ -43,11 +43,13 @@ class SoulsTidyAssets:
 	# 神赐 
 	I_ST_GOD_PRESENT = RuleImage(roi_front=(578,234,131,73), roi_back=(542,117,204,219), threshold=0.8, method="Template matching", file="./tasks/SoulsTidy/simple/simple_st_god_present.png")
 	# 已弃置被选中 
-	I_ST_ABANDONED_SELECTED = RuleImage(roi_front=(20,110,140,50), roi_back=(20,110,140,50), threshold=0.8, method="Template matching", file="./tasks/SoulsTidy/simple/simple_st_abandoned_selected.png")
+	I_ST_ABANDONED_SELECTED = RuleImage(roi_front=(47,118,84,33), roi_back=(45,119,85,34), threshold=0.8, method="Template matching", file="./tasks/SoulsTidy/simple/simple_st_abandoned_selected.png")
 	# 第一个御魂是+0的 
 	I_ST_LEVEL_0 = RuleImage(roi_front=(85,235,45,30), roi_back=(85,235,45,30), threshold=0.9, method="Template matching", file="./tasks/SoulsTidy/simple/simple_st_level_0.png")
 	# 御魂奉纳后获得的金币 
 	I_ST_GOLD = RuleImage(roi_front=(170,100,950,500), roi_back=(170,100,950,500), threshold=0.9, method="Template matching", file="./tasks/SoulsTidy/simple/simple_st_gold.png")
+	# description 
+	I_ST_ABANDONED_NOT_SELECTED = RuleImage(roi_front=(22,108,243,56), roi_back=(21,106,245,60), threshold=0.8, method="Template matching", file="./tasks/SoulsTidy/simple/image_name.png")
 
 
 	# Long Click Rule Assets
@@ -72,5 +74,7 @@ class SoulsTidyAssets:
 	O_ST_SORT_LOCATION = RuleOcr(roi=(415,119,61,39), area=(415,119,61,39), mode="Single", method="Default", keyword="位置", name="st_sort_location")
 	# Ocr-description 
 	O_ST_OVERFLOW = RuleOcr(roi=(686,397,109,48), area=(686,397,109,48), mode="Single", method="Default", keyword="知道了", name="st_overflow")
+	# detail 
+	O_ST_DETAIL = RuleOcr(roi=(1176.6666666666667,310.66666666666674,100,100), area=(1179.3333333333333,308.66666666666674,100,100), mode="Single", method="Default", keyword="", name="st_detail")
 
 

+ 3 - 3
tasks/SoulsTidy/script_task.py

@@ -100,7 +100,7 @@ class ScriptTask(GameUi, SoulsTidyAssets):
         logger.hr('Enter bongna')
         # 进入已弃置界面
         while True:
-            if not self.appear(self.I_ST_ABANDONED_SELECTED):
+            if self.appear(self.I_ST_ABANDONED_NOT_SELECTED):
                 self.click(self.I_ST_ABANDONED_SELECTED, interval=2)
                 continue
             break
@@ -181,5 +181,5 @@ if __name__ == '__main__':
     d = Device(c)
     t = ScriptTask(c, d)
 
-    t.greed_maneki()
-    # t.run()
+    #t.greed_maneki()
+    t.run()

+ 2 - 2
tasks/SoulsTidy/simple/click.json

@@ -1,8 +1,8 @@
 [
   {
     "itemName": "st_detail",
-    "roiFront": "1189,321,87,74",
-    "roiBack": "1189,321,87,74",
+    "roiFront": "1162,230,87,74",
+    "roiBack": "1164,229,87,74",
     "description": "御魂详细"
   },
   {

+ 11 - 2
tasks/SoulsTidy/simple/image.json

@@ -110,8 +110,8 @@
   {
     "itemName": "st_abandoned_selected",
     "imageName": "simple_st_abandoned_selected.png",
-    "roiFront": "20,110,140,50",
-    "roiBack": "20,110,140,50",
+    "roiFront": "47,118,84,33",
+    "roiBack": "45,119,85,34",
     "method": "Template matching",
     "threshold": 0.8,
     "description": "已弃置被选中"
@@ -133,5 +133,14 @@
     "method": "Template matching",
     "threshold": 0.9,
     "description": "御魂奉纳后获得的金币"
+  },
+  {
+    "itemName": "st_abandoned_not_selected",
+    "imageName": "image_name.png",
+    "roiFront": "22,108,243,56",
+    "roiBack": "21,106,245,60",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "description"
   }
 ]

BIN
tasks/SoulsTidy/simple/image_name.png


+ 9 - 0
tasks/SoulsTidy/simple/ocr.json

@@ -70,5 +70,14 @@
     "method": "Default",
     "keyword": "知道了",
     "description": "Ocr-description"
+  },
+  {
+    "itemName": "st_detail",
+    "roiFront": "1176.6666666666667,310.66666666666674,100,100",
+    "roiBack": "1179.3333333333333,308.66666666666674,100,100",
+    "mode": "Single",
+    "method": "Default",
+    "keyword": "",
+    "description": "detail"
   }
 ]

BIN
tasks/SoulsTidy/simple/simple_st_abandoned_selected.png


BIN
tasks/SoulsTidy/simple/simple_st_souls.png