Sfoglia il codice sorgente

feat(LootStatistics): Add test frame

huangrunheng 2 anni fa
parent
commit
d16239ca05

+ 5 - 0
tasks/Component/LootStatistics/README.md

@@ -0,0 +1,5 @@
+
+
+掉落统计模块,将其作为通用战斗模块的父类
+
+

+ 17 - 0
tasks/Component/LootStatistics/assets.py

@@ -0,0 +1,17 @@
+from module.atom.image import RuleImage
+from module.atom.click import RuleClick
+from module.atom.long_click import RuleLongClick
+from module.atom.swipe import RuleSwipe
+from module.atom.ocr import RuleOcr
+from module.atom.list import RuleList
+
+# This file was automatically generated by ./dev_tools/assets_extract.py.
+# Don't modify it manually.
+class LootStatisticsAssets: 
+
+
+	# Image Rule Assets
+	# 突破卷 
+	I_REALM_RAID_PASS = RuleImage(roi_front=(402,175,100,100), roi_back=(251,161,809,128), threshold=0.8, method="Template matching", file="./tasks/Component/LootStatistics/ls/ls_realm_raid_pass.png")
+
+

+ 26 - 0
tasks/Component/LootStatistics/loot_staistics.py

@@ -0,0 +1,26 @@
+# This Python file uses the following encoding: utf-8
+# @author runhey
+# github https://github.com/runhey
+from module.atom.click import RuleClick
+from module.atom.image import RuleImage
+from module.atom.ocr import RuleOcr
+from module.base.timer import Timer
+from module.logger import logger
+
+from tasks.base_task import BaseTask
+
+
+class LootStatistics(BaseTask):
+
+    def loot_detect(self, image) -> dict:
+        """
+
+        :param image:
+        :return: 返回举例
+        {
+        "RealmRaidPass": 1,
+        }
+        """
+        return {}
+
+

+ 15 - 0
tasks/Component/LootStatistics/loots_config.py

@@ -0,0 +1,15 @@
+# This Python file uses the following encoding: utf-8
+# @author runhey
+# github https://github.com/runhey
+
+
+from enum import Enum
+from datetime import datetime, time
+from pydantic import BaseModel, ValidationError, validator, Field
+
+from tasks.Component.config_base import ConfigBase
+
+# 可以从这儿找
+# https://onmyoji.fandom.com/wiki/Items
+class Item(str, Enum):
+    Realm_Raid_Pass = 'RealmRaidPass'  # 突破券

+ 11 - 0
tasks/Component/LootStatistics/ls/image1.json

@@ -0,0 +1,11 @@
+[
+  {
+    "itemName": "realm_raid_pass",
+    "imageName": "ls_realm_raid_pass.png",
+    "roiFront": "402,175,100,100",
+    "roiBack": "251,161,809,128",
+    "method": "Template matching",
+    "threshold": 0.8,
+    "description": "突破卷"
+  }
+]

BIN
tasks/Component/LootStatistics/ls/ls_realm_raid_pass.png