浏览代码

fix(RichMan): rollback commit/62f5385daacc7588a28226723c6943e686729e88
Incorrect json file modification

huangrunheng 2 年之前
父节点
当前提交
00c35c34f7
共有 5 个文件被更改,包括 35 次插入 和 11 次删除
  1. 5 5
      dev_tools/assets_test.py
  2. 3 2
      tasks/GlobalGame/assets.py
  3. 13 0
      tasks/RichMan/assets.py
  4. 2 2
      tasks/RichMan/script_task.py
  5. 12 2
      tasks/RichMan/shrine/ocr.json

+ 5 - 5
dev_tools/assets_test.py

@@ -34,13 +34,13 @@ def detect_ocr(file: str, target: RuleOcr):
 
 
 # 图片文件路径 可以是相对路径
-IMAGE_FILE = r"C:\Users\Ryland\Desktop\QQ截图20240407130042.png"
+IMAGE_FILE = r"C:\Users\萌萌哒\Desktop\341978692-fdceb33c-eec1-4965-a2b9-8f75cd54d5e2.png"
 if __name__ == '__main__':
-    from tasks.KekkaiActivation.assets import KekkaiActivationAssets
-    from tasks.GameUi.assets import GameUiAssets
-
-    targe = GameUiAssets.I_MAIN_GOTO_TEAM
+    from tasks.RyouToppa.assets import RyouToppaAssets
+    targe = RyouToppaAssets.I_RYOU_TOPPA
     print(detect_image(IMAGE_FILE, targe))
+
+    # ocr demo
     # from tasks.KekkaiActivation.assets import KekkaiActivationAssets
     # target = KekkaiActivationAssets.O_CARD_ALL_TIME
     # print(detect_ocr(IMAGE_FILE, target))

+ 3 - 2
tasks/GlobalGame/assets.py

@@ -9,6 +9,7 @@ from module.atom.list import RuleList
 # Don't modify it manually.
 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")
@@ -16,9 +17,9 @@ class GlobalGameAssets:
 	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_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_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_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_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")

+ 13 - 0
tasks/RichMan/assets.py

@@ -337,6 +337,19 @@ class RichManAssets:
 	I_CENTER2 = RuleImage(roi_front=(76,590,79,75), roi_back=(65,575,100,100), threshold=0.8, method="Template matching", file="./tasks/RichMan/shrine/shrine_center2.png")
 
 
+	# Ocr Rule Assets
+	# Ocr-description 
+	O_S_TOTAL = RuleOcr(roi=(1134,11,112,36), area=(1134,11,112,36), mode="Digit", method="Default", keyword="", name="s_total")
+	# 已兑换 
+	O_S_BLACK = RuleOcr(roi=(582,179,84,48), area=(582,179,84,48), mode="Single", method="Default", keyword="", name="s_black")
+	# Ocr-description 
+	O_S_WHITE_FIVE = RuleOcr(roi=(774,174,69,44), area=(774,174,69,44), mode="Single", method="Default", keyword="", name="s_white_five")
+	# Ocr-description 
+	O_S_WHITE_FOUR = RuleOcr(roi=(952,168,74,60), area=(952,168,74,60), mode="Single", method="Default", keyword="", name="s_white_four")
+	# 买两个四星蛋 
+	O_S_FOUR_NUMBER = RuleOcr(roi=(581,414,46,45), area=(581,414,46,45), mode="Digit", method="Default", keyword="2", name="s_four_number")
+
+
 	# Image Rule Assets
 	# 千物宝库 
 	I_TT_ENTER = RuleImage(roi_front=(1140,585,73,76), roi_back=(1140,585,73,76), threshold=0.8, method="Template matching", file="./tasks/RichMan/tt/tt_tt_enter.png")

+ 2 - 2
tasks/RichMan/script_task.py

@@ -48,8 +48,8 @@ if __name__ == '__main__':
     d = Device(c)
     t = ScriptTask(c, d)
 
-    # t.run()
-    t.execute_mall()
+    t.run()
+    # t.execute_mall()
 
 
 

+ 12 - 2
tasks/RichMan/shrine/ocr.json

@@ -1,37 +1,47 @@
 [
   {
     "itemName": "s_total",
-    "roiFront": "1164,11,74,36",
-    "roiBack": "1164,11,74,36",
+    "roiFront": "1134,11,112,36",
+    "roiBack": "1134,11,112,36",
+    "mode": "Digit",
     "method": "Default",
+    "keyword": "",
     "description": "Ocr-description"
   },
   {
     "itemName": "s_black",
     "roiFront": "582,179,84,48",
     "roiBack": "582,179,84,48",
+    "mode": "Single",
     "method": "Default",
+    "keyword": "",
     "description": "已兑换"
   },
   {
     "itemName": "s_white_five",
     "roiFront": "774,174,69,44",
     "roiBack": "774,174,69,44",
+    "mode": "Single",
     "method": "Default",
+    "keyword": "",
     "description": "Ocr-description"
   },
   {
     "itemName": "s_white_four",
     "roiFront": "952,168,74,60",
     "roiBack": "952,168,74,60",
+    "mode": "Single",
     "method": "Default",
+    "keyword": "",
     "description": "Ocr-description"
   },
   {
     "itemName": "s_four_number",
     "roiFront": "581,414,46,45",
     "roiBack": "581,414,46,45",
+    "mode": "Digit",
     "method": "Default",
+    "keyword": "2",
     "description": "买两个四星蛋"
   }
 ]