Przeglądaj źródła

feat(ocr) ocr assets extract

runhey 3 lat temu
rodzic
commit
c55a3ba27f

+ 4 - 2
module/config/config_menu.py

@@ -16,12 +16,14 @@ class ConfigMenu:
         self.menu["Overview"] = []
         # 脚本设置
         self.menu['Script'] = ['Script', 'General', 'Restart', 'GlobalGame']
-        # 开发工具
-        self.menu["Tools"] = ['Image Rule', 'Ocr Rule', 'Click Rule', 'Long Click Rule', 'Swipe Rule']
         # 刷御魂
         self.menu["Soul Zones"] = ['Orochi', 'OrochiMoans', 'OrochiJudgement', 'Sougenbi', 'FallenSun', 'EternitySea']
         # 日常的任务
         self.menu["Daily Task"] = ['AreaBoss', 'GoldYoukai', 'ExperienceYoukai', 'Nian']
+
+        # 开发工具
+        self.menu["Tools"] = ['Image Rule', 'Ocr Rule', 'Click Rule', 'Long Click Rule', 'Swipe Rule']
+
     @cached_property
     def gui_menu(self) -> str:
         """

+ 52 - 7
module/dev_tools/assets_extract.py

@@ -17,6 +17,7 @@ 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
 
 # This file was automatically generated by module/dev_tools/assets_extract.py.
 # Don't modify it manually.
@@ -49,7 +50,7 @@ class ImageExtractor:
         self.file = str(Path(file).resolve().relative_to((Path.cwd()).resolve()).as_posix())
         self.image_path = Path(self.file).parent.as_posix()
 
-        self._result = '\n\t# Image Rule Assets\n'
+        self._result = '\n\n\t# Image Rule Assets\n'
         for item in data:
             self._result += self.extract_item(item)
 
@@ -80,7 +81,7 @@ class ClickExtractor:
         click rule 提取
         :param data:  json解析后的数据
         """
-        self._result = '\t# Click Rule Assets\n'
+        self._result = '\n\n\t# Click Rule Assets\n'
         for item in data:
             self._result += self.extract_item(item)
 
@@ -108,7 +109,7 @@ class LongClickExtractor:
         long click rule 提取
         :param data:  json解析后的数据
         """
-        self._result = '\t# Long Click Rule Assets\n'
+        self._result = '\n\n\t# Long Click Rule Assets\n'
         for item in data:
             self._result += self.extract_item(item)
 
@@ -137,7 +138,7 @@ class SwipeExtractor:
         swipe rule 提取
         :param data:  json解析后的数据
         """
-        self._result = '\t# Swipe Rule Assets\n'
+        self._result = '\n\n\t# Swipe Rule Assets\n'
         for item in data:
             self._result += self.extract_item(item)
 
@@ -159,6 +160,36 @@ class SwipeExtractor:
                     f'name="{item["itemName"]}")\n'
         return description + name
 
+class OcrExtractor:
+    def __init__(self, file: str, data: list) -> None:
+        """
+        swipe rule 提取
+        :param data:  json解析后的数据
+        """
+        self._result = '\n\n\t# Swipe Rule Assets\n'
+        for item in data:
+            self._result += self.extract_item(item)
+
+    @property
+    def result(self) -> str:
+        return self._result
+
+    @classmethod
+    def extract_item(cls, item) -> str:
+        """
+        解析每一项,返回字符串
+        :param item:
+        :return:
+        """
+        description: str = f'\t# {item["description"]} \n'
+        name: str = f'\tS_{name_transform(item["itemName"])} = RuleOcr(' \
+                    f'roi=({item["roiFront"]}), ' \
+                    f'area=({item["roiBack"]}), ' \
+                    f'mode="{item["mode"]}", ' \
+                    f'method="{item["method"]}", ' \
+                    f'keyword="{item["keyword"]}", ' \
+                    f'name="{item["itemName"]}")\n'
+        return description + name
 
 class AssetsExtractor:
 
@@ -237,12 +268,24 @@ class AssetsExtractor:
     @classmethod
     def is_swipe_file(cls, data: list) -> bool:
         """
-        判断是不是swiperule 文件
+        判断是不是swipe rule 文件
+        :param data: 解析后的json数据,是list
+        :return:
+        """
+        item = data[0]
+        if 'mode' in item and len(item) == 5:
+            return True
+        return False
+
+    @classmethod
+    def is_ocr_file(cls, data: list) -> bool:
+        """
+        判断是不是ocr 文件
         :param data: 解析后的json数据,是list
         :return:
         """
         item = data[0]
-        if 'mode' in item:
+        if 'keyword' in item:
             return True
         return False
 
@@ -272,6 +315,8 @@ class AssetsExtractor:
                 result += LongClickExtractor(file, data).result
             elif self.is_swipe_file(data):
                 result += SwipeExtractor(file, data).result
+            elif self.is_ocr_file(data):
+                result += OcrExtractor(file, data).result
 
         if result == '':
             logger.error(f'There are no resource files under the {self.task_name} task')
@@ -300,6 +345,6 @@ class AllAssetsExtractor:
 
 
 if __name__ == "__main__":
-    # c = AssetsExtractor('GeneralBattle')
+    # c = AssetsExtractor('CoinChallenge')
     # c.extract()
     AllAssetsExtractor()

+ 0 - 1
module/gui/qml/Component/SplitPanel.qml

@@ -38,7 +38,6 @@ Item {
 
         onLoaded: {
             if(typeof contentDefalut.item.splitPanel === "undefined"){
-                console.debug('还没有属性')
                 return
             }
 

+ 1 - 1
module/gui/qml/Content/ClickRule.qml

@@ -313,7 +313,7 @@ Item {
             data.push(itemData)
         }
 
-        ruleFile.rule_file.write_file(ruleFile.file, JSON.stringify(data))
+        ruleFile.rule_file.write_file(ruleFile.file, JSON.stringify(data, null, "  "))
         showSuccess("Save file")
 
     }

+ 1 - 1
module/gui/qml/Content/ImageRule.qml

@@ -341,7 +341,7 @@ Item {
             data.push(itemData)
         }
 
-        ruleFile.rule_file.write_file(ruleFile.file, JSON.stringify(data))
+        ruleFile.rule_file.write_file(ruleFile.file, JSON.stringify(data, null, "  "))
         showSuccess("Save file")
 
     }

+ 1 - 1
module/gui/qml/Content/LongClickRule.qml

@@ -272,7 +272,7 @@ Item {
             data.push(itemData)
         }
 
-        ruleFile.rule_file.write_file(ruleFile.file, JSON.stringify(data))
+        ruleFile.rule_file.write_file(ruleFile.file, JSON.stringify(data, null, "  "))
         showSuccess("Save file")
 
     }

+ 354 - 1
module/gui/qml/Content/OcrRule.qml

@@ -1,5 +1,358 @@
-import QtQuick 2.0
+import QtQuick
+import QtQuick.Controls
+import FluentUI
+import "../Component"
 
 Item {
 
+    MirrorImage{
+        id: mirrorImage
+        anchors{
+            left: parent.left
+            top: parent.top
+        }
+        width: 1280
+        height: 720 + 50
+        imageWidth: 1280
+        imageHeight: 720
+
+        onRoi_red_changed: function(roi){
+            if(typeof ruleFile.currentItem === "undefined"){
+                return
+            }
+            ruleFile.currentItem.roiFront = roi
+        }
+
+        onRoi_green_changed: function(roi){
+            if(typeof ruleFile.currentItem === "undefined"){
+                return
+            }
+            ruleFile.currentItem.roiBack = roi
+        }
+    }
+    RuleFile{
+        id: ruleFile
+        anchors{
+            left: mirrorImage.right
+            leftMargin: 10
+            right: parent.right
+            top: parent.top
+        }
+        height: 600
+        addFunc: add
+        editFunc: edit
+        saveFunc: save
+
+        onCurrentItemChanged: {
+            if(currentItem === "" || typeof currentItem === "undefined"){
+                return
+            }
+            var [x, y, width, height] = currentItem.roiFront.split(',')
+            mirrorImage.roiRed_x = parseInt(x)
+            mirrorImage.roiRed_y = parseInt(y)
+            mirrorImage.roiRed_width = parseInt(width)
+            mirrorImage.roiRed_height = parseInt(height)
+            var [x, y, width, height] = currentItem.roiBack.split(',')
+            mirrorImage.roiGreen_x = parseInt(x)
+            mirrorImage.roiGreen_y = parseInt(y)
+            mirrorImage.roiGreen_width = parseInt(width)
+            mirrorImage.roiGreen_height = parseInt(height)
+
+        }
+    }
+
+    FluArea {
+        id: ruleArea
+        anchors{
+            left: mirrorImage.right
+            leftMargin: 10
+            right: parent.right
+            top: ruleFile.bottom
+            topMargin: 12
+            bottom: parent.bottom
+        }
+        Column{
+            id: coi
+            anchors{
+                top: parent.top
+                bottom: parent.bottom
+                left: parent.left
+                leftMargin: 20
+                right: parent.right
+                rightMargin: 20
+            }
+            spacing: 5
+            //头
+            Item{
+                width: coi.width
+                height: 40
+                FluText{
+                    anchors.left: parent.left
+                    anchors.verticalCenter: parent.verticalCenter
+                    text: "Editing rule"
+                    font: FluTextStyle.Subtitle
+                }
+            }
+            //item name 这个参数项的名称
+            Item{
+                width: coi.width
+                height: 40
+                FluText{
+                    anchors.left: parent.left
+                    anchors.verticalCenter: parent.verticalCenter
+                    text: "Item name"
+                    font: FluTextStyle.BodyStrong
+                }
+                FluTextBox{
+                    id: itemName
+                    anchors{
+                        right: parent.right
+                        verticalCenter: parent.verticalCenter
+                    }
+                    placeholderText:"单行输入框"
+                    disabled: true
+                    text: (typeof ruleFile.currentItem === "undefined")? "" : ruleFile.currentItem.itemName
+                    width: 200
+                }
+            }
+
+            // roi front
+            Item{
+                width: coi.width
+                height: 40
+                FluText{
+                    anchors.left: parent.left
+                    anchors.verticalCenter: parent.verticalCenter
+                    text: "Roi front"
+                    font: FluTextStyle.BodyStrong
+                }
+                FluTextBox{
+                    id: roiFront
+                    anchors{
+                        right: parent.right
+                        verticalCenter: parent.verticalCenter
+                    }
+                    disabled: true
+                    text:(typeof ruleFile.currentItem === "undefined")? "" : ruleFile.currentItem.roiFront
+                    placeholderText:"0,0,100,100"
+                    width: 200
+                }
+            }
+            //roi back
+            Item{
+                width: coi.width
+                height: 40
+                FluText{
+                    anchors.left: parent.left
+                    anchors.verticalCenter: parent.verticalCenter
+                    text: "Roi Back"
+                    font: FluTextStyle.BodyStrong
+                }
+                FluTextBox{
+                    id: roiBack
+                    anchors{
+                        right: parent.right
+                        verticalCenter: parent.verticalCenter
+                    }
+                    disabled: true
+                    text:(typeof ruleFile.currentItem === "undefined")? "" : ruleFile.currentItem.roiBack
+                    placeholderText:"0,0,100,100"
+                    width: 200
+
+
+                }
+            }
+            //ocr 模式
+            Item{
+                width: coi.width
+                height: 40
+                FluText{
+                    anchors.left: parent.left
+                    anchors.verticalCenter: parent.verticalCenter
+                    text: "Mode"
+                    font: FluTextStyle.BodyStrong
+                }
+                FComboBox{
+                    id: mode
+                    anchors{
+                        right: parent.right
+                        verticalCenter: parent.verticalCenter
+                    }
+                    width: 200
+                    model: ["Single", "Full", "Digit", "DigitCounter", "Duration"]
+                    currentIndex: if(typeof ruleFile.currentItem !== "undefined"){
+                                     if(ruleFile.currentItem.mode === "Single"){
+                                         return 0
+                                     }else if(ruleFile.currentItem.mode === "Full"){
+                                         return 1
+                                     }else if(ruleFile.currentItem.mode === "Digit"){
+                                         return 2
+                                     }else if(ruleFile.currentItem.mode === "DigitCounter"){
+                                         return 3
+                                     }else if(ruleFile.currentItem.mode === "Duration"){
+                                         return 4
+                                     }
+                                  }else{return 0}
+                    onActivated: {
+                        if(currentIndex === 0){
+                            ruleFile.currentItem.mode = "Single"
+                        }
+                        else if(currentIndex === 1){
+                            ruleFile.currentItem.mode = "Full"
+                        }
+                        else if(currentIndex === 1){
+                            ruleFile.currentItem.mode = "Digit"
+                        }
+                        else if(currentIndex === 1){
+                            ruleFile.currentItem.mode = "DigitCounter"
+                        }
+                        else if(currentIndex === 1){
+                            ruleFile.currentItem.mode = "Duration"
+                        }
+                    }
+                }
+            }
+            // ocr 方法
+            Item{
+                width: coi.width
+                height: 40
+                FluText{
+                    anchors.left: parent.left
+                    anchors.verticalCenter: parent.verticalCenter
+                    text: "Method"
+                    font: FluTextStyle.BodyStrong
+                }
+                FComboBox{
+                    id: method
+                    anchors{
+                        right: parent.right
+                        verticalCenter: parent.verticalCenter
+                    }
+                    width: 200
+                    currentIndex: 0
+                    model: ["Default"]
+                    onActivated: {
+
+                    }
+                }
+            }
+            //keyword 匹配字段
+            Item{
+                width: coi.width
+                height: 40
+                FluText{
+                    anchors.left: parent.left
+                    anchors.verticalCenter: parent.verticalCenter
+                    text: "Keyword"
+                    font: FluTextStyle.BodyStrong
+                }
+                FluTextBox{
+                    id: keyword
+                    anchors{
+                        right: parent.right
+                        verticalCenter: parent.verticalCenter
+                    }
+                    width: 200
+                    text:(typeof ruleFile.currentItem === "undefined")? "" : ruleFile.currentItem.keyword
+                    placeholderText:""
+                    onEditingFinished: {
+                        if(typeof ruleFile.currentItem === "undefined"){
+                            return
+                        }
+                        ruleFile.currentItem.keyword = text
+                    }
+                }
+            }
+
+            //描述 description
+            Item{
+                width: coi.width
+                height: 40
+                FluText{
+                    anchors.left: parent.left
+                    anchors.verticalCenter: parent.verticalCenter
+                    text: "Description"
+                    font: FluTextStyle.BodyStrong
+                }
+                FluTextBox{
+                    id: description
+                    anchors{
+                        right: parent.right
+                        verticalCenter: parent.verticalCenter
+                    }
+                    width: 200
+                    text:(typeof ruleFile.currentItem === "undefined")? "" : ruleFile.currentItem.description
+                    placeholderText:"input your description"
+                    onEditingFinished: {
+                        if(typeof ruleFile.currentItem === "undefined"){
+                            return
+                        }
+                        ruleFile.currentItem.description = text
+                    }
+                }
+            }
+
+        }
+
+    }
+
+    // 帮助
+    FluArea{
+        id: ruleHelp
+        anchors{
+            left: parent.left
+            right: ruleArea.left
+            rightMargin: 10
+            top: mirrorImage.bottom
+            topMargin: 10
+            bottom: parent.bottom
+        }
+        FluText{
+            leftPadding: 12
+            topPadding: 12
+            text: "红色的框(Roi front = roi)表示这一个项OCR识别的默认范围,绿色的框(Roi Back = area)表示如果识别到会点击的的范围。
+在移动边框时右边的roi并不会实时显示,当切换软件的焦点时更新显示,但是具体的数值是更新的。
+投屏的设置最上边点击即可"
+        }
+
+    }
+
+    function add(){
+        const item ={}
+        item["itemName"] = "new-ocr-item"
+        item["roiFront"] = "0,0,100,100"
+        item["roiBack"] = "0,0,100,100"
+        item["mode"] = "Single"
+        item["method"] = "Default"
+        item["keyword"] = ""
+        item["description"] = "Ocr-description"
+        showSuccess("Add new item")
+        return item
+    }
+
+    function edit(model){
+
+    }
+
+    function save(){
+        const data = []
+        for(var i=0; i<ruleFile.list_model.count; i++){
+            const item = ruleFile.list_model.get(i)
+            const itemData = {}
+            itemData["itemName"] = item["itemName"]
+            itemData["roiFront"] = item["roiFront"]
+            itemData["roiBack"] = item["roiBack"]
+            itemData["mode"] = item["mode"]
+            itemData["method"] = item["method"]
+            itemData["keyword"] = item["keyword"]
+            itemData["description"] = item["description"]
+            data.push(itemData)
+        }
+
+        ruleFile.rule_file.write_file(ruleFile.file, JSON.stringify(data, null, "  "))
+        showSuccess("Save file")
+
+    }
+
+
 }

+ 2 - 2
module/gui/qml/Content/SwipeRule.qml

@@ -163,7 +163,7 @@ Item {
 
                 }
             }
-            //长按的时间间隔
+            //滑动模式
             Item{
                 width: coi.width
                 height: 40
@@ -282,7 +282,7 @@ Item {
             data.push(itemData)
         }
 
-        ruleFile.rule_file.write_file(ruleFile.file, JSON.stringify(data))
+        ruleFile.rule_file.write_file(ruleFile.file, JSON.stringify(data, null, "  "))
         showSuccess("Save file")
 
     }

+ 2 - 0
tasks/AreaBoss/assets.py

@@ -2,11 +2,13 @@ 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
 
 # This file was automatically generated by module/dev_tools/assets_extract.py.
 # Don't modify it manually.
 class AreaBossAssets: 
 
+
 	# Image Rule Assets
 	# 探索图标 
 	I_EXPLORE = RuleImage(roi_front=(758,122,66,77), roi_back=(339,104,836,120), threshold=0.8, method="Template matching", file="./tasks/AreaBoss/res/res_explore.png")

+ 23 - 0
tasks/CoinChallenge/assets.py

@@ -2,11 +2,13 @@ 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
 
 # This file was automatically generated by module/dev_tools/assets_extract.py.
 # Don't modify it manually.
 class CoinChallengeAssets: 
 
+
 	# Image Rule Assets
 	# description 
 	I_NEW1 = RuleImage(roi_front=(157,240,70,79), roi_back=(41,185,279,207), threshold=0.8, method="Template matching", file="./tasks/CoinChallenge/res/res_new1.png")
@@ -14,6 +16,8 @@ class CoinChallengeAssets:
 	I_NEW2 = RuleImage(roi_front=(362,243,100,100), roi_back=(803,101,100,100), threshold=0.8, method="Template matching", file="./tasks/CoinChallenge/res/res_new2.png")
 	# desc55 
 	I_NEW3 = RuleImage(roi_front=(568,212,240,220), roi_back=(0,0,100,100), threshold=0.9, method="Template matching", file="./tasks/CoinChallenge/res/res_new3.png")
+
+
 	# Click Rule Assets
 	# description 
 	C_NEW1 = RuleClick(roi_front=(268,268,100,100), roi_back=(614,214,100,100), name="new1")
@@ -21,6 +25,8 @@ class CoinChallengeAssets:
 	C_NEW2 = RuleClick(roi_front=(171,236,100,100), roi_back=(554,225,100,100), name="new2")
 	# desc444n 
 	C_NEW3 = RuleClick(roi_front=(180,150,100,100), roi_back=(596,247,100,100), name="new3")
+
+
 	# Long Click Rule Assets
 	# description 
 	L_NEW1 = RuleLongClick(roi_front=(208,151,100,100), roi_back=(542,279,100,100), duration=1500, name="new1")
@@ -28,6 +34,23 @@ class CoinChallengeAssets:
 	L_NEW2 = RuleLongClick(roi_front=(355,191,100,100), roi_back=(526,323,100,100), duration=1500, name="new2")
 	# de66666n 
 	L_NEW3 = RuleLongClick(roi_front=(112,156,100,100), roi_back=(469,200,100,100), duration=1000, name="new3")
+
+
+	# Swipe Rule Assets
+	# Ocr-description 
+	S_NEW_FULL = RuleOcr(roi=(255,129,628,100), area=(637,418,100,100), mode="Full", method="Default", keyword="探索", name="new_full")
+	# Ocr-description 
+	S_NEW_SINGLE_V = RuleOcr(roi=(564,255,105,159), area=(0,0,100,100), mode="Single", method="Default", keyword="式神育成", name="new_single_v")
+	# Ocr-description 
+	S_NEW_SINGLE_H = RuleOcr(roi=(78,19,143,63), area=(314,169,100,100), mode="Single", method="Default", keyword="式神育成", name="new_single_h")
+	# Ocr-description 
+	S_DIGIT = RuleOcr(roi=(408,173,51,43), area=(0,0,100,100), mode="Single", method="Default", keyword="", name="digit")
+	# Ocr-description 
+	S_DIGIT_COUNTER = RuleOcr(roi=(1134,6,100,56), area=(0,0,100,100), mode="Single", method="Default", keyword="", name="digit_counter")
+	# Ocr-description 
+	S_DURATION = RuleOcr(roi=(923,256,100,46), area=(0,0,100,100), mode="Single", method="Default", keyword="育成_结界卡剩余时间", name="duration")
+
+
 	# Swipe Rule Assets
 	# description 
 	S_NEW1 = RuleSwipe(roi_front=(253,212,100,100), roi_back=(652,292,100,100), mode="default", name="new1")

+ 56 - 0
tasks/CoinChallenge/res/test_ocr.json

@@ -0,0 +1,56 @@
+[
+  {
+    "itemName": "new_full",
+    "roiFront": "255,129,628,100",
+    "roiBack": "637,418,100,100",
+    "mode": "Full",
+    "method": "Default",
+    "keyword": "探索",
+    "description": "Ocr-description"
+  },
+  {
+    "itemName": "new_single_v",
+    "roiFront": "564,255,105,159",
+    "roiBack": "0,0,100,100",
+    "mode": "Single",
+    "method": "Default",
+    "keyword": "式神育成",
+    "description": "Ocr-description"
+  },
+  {
+    "itemName": "new_single_h",
+    "roiFront": "78,19,143,63",
+    "roiBack": "314,169,100,100",
+    "mode": "Single",
+    "method": "Default",
+    "keyword": "式神育成",
+    "description": "Ocr-description"
+  },
+  {
+    "itemName": "digit",
+    "roiFront": "408,173,51,43",
+    "roiBack": "0,0,100,100",
+    "mode": "Single",
+    "method": "Default",
+    "keyword": "",
+    "description": "Ocr-description"
+  },
+  {
+    "itemName": "digit_counter",
+    "roiFront": "1134,6,100,56",
+    "roiBack": "0,0,100,100",
+    "mode": "Single",
+    "method": "Default",
+    "keyword": "",
+    "description": "Ocr-description"
+  },
+  {
+    "itemName": "duration",
+    "roiFront": "923,256,100,46",
+    "roiBack": "0,0,100,100",
+    "mode": "Single",
+    "method": "Default",
+    "keyword": "育成_结界卡剩余时间",
+    "description": "Ocr-description"
+  }
+]

+ 1 - 0
tasks/DemonEncounter/assets.py

@@ -2,6 +2,7 @@ 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
 
 # This file was automatically generated by module/dev_tools/assets_extract.py.
 # Don't modify it manually.

+ 1 - 0
tasks/EternitySea/assets.py

@@ -2,6 +2,7 @@ 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
 
 # This file was automatically generated by module/dev_tools/assets_extract.py.
 # Don't modify it manually.

+ 1 - 0
tasks/ExperienceYoukai/assets.py

@@ -2,6 +2,7 @@ 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
 
 # This file was automatically generated by module/dev_tools/assets_extract.py.
 # Don't modify it manually.

+ 1 - 0
tasks/FallenSun/assets.py

@@ -2,6 +2,7 @@ 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
 
 # This file was automatically generated by module/dev_tools/assets_extract.py.
 # Don't modify it manually.

+ 1 - 0
tasks/General/assets.py

@@ -2,6 +2,7 @@ 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
 
 # This file was automatically generated by module/dev_tools/assets_extract.py.
 # Don't modify it manually.

+ 6 - 0
tasks/GeneralBattle/assets.py

@@ -2,10 +2,13 @@ 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
 
 # This file was automatically generated by module/dev_tools/assets_extract.py.
 # Don't modify it manually.
 class GeneralBattleAssets: 
+
+
 	# Click Rule Assets
 	# 预设队伍1 
 	C_PRESET_TEAM_1 = RuleClick(roi_front=(196,234,464,114), roi_back=(196,234,464,114), name="preset_team_1")
@@ -44,6 +47,7 @@ class GeneralBattleAssets:
 	# 战斗的时候有一定的概率随机点击 
 	C_RANDOM_CLICK = RuleClick(roi_front=(104,79,1050,507), roi_back=(255,65,100,100), name="random_click")
 
+
 	# Image Rule Assets
 	# 奖励,就是那个魂 
 	I_REWARD = RuleImage(roi_front=(547,518,172,96), roi_back=(547,518,172,96), threshold=0.8, method="Template matching", file="./tasks/GeneralBattle/res/res_reward.png")
@@ -77,6 +81,8 @@ class GeneralBattleAssets:
 	I_LOCAL = RuleImage(roi_front=(25,563,30,34), roi_back=(25,563,30,34), threshold=0.8, method="Template matching", file="./tasks/GeneralBattle/res/res_local.png")
 	# description 
 	I_STATISTICS = RuleImage(roi_front=(61,644,33,28), roi_back=(61,644,33,28), threshold=0.8, method="Template matching", file="./tasks/GeneralBattle/res/res_statistics.png")
+
+
 	# Swipe Rule Assets
 	# description 
 	S_BATTLE_RANDOM_LEFT = RuleSwipe(roi_front=(122,155,480,426), roi_back=(667,147,461,427), mode="default", name="battle_random_left")

+ 1 - 0
tasks/GlobalGame/assets.py

@@ -2,6 +2,7 @@ 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
 
 # This file was automatically generated by module/dev_tools/assets_extract.py.
 # Don't modify it manually.

+ 1 - 0
tasks/GoldYoukai/assets.py

@@ -2,6 +2,7 @@ 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
 
 # This file was automatically generated by module/dev_tools/assets_extract.py.
 # Don't modify it manually.

+ 1 - 0
tasks/Hunt/assets.py

@@ -2,6 +2,7 @@ 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
 
 # This file was automatically generated by module/dev_tools/assets_extract.py.
 # Don't modify it manually.

+ 1 - 0
tasks/Nian/assets.py

@@ -2,6 +2,7 @@ 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
 
 # This file was automatically generated by module/dev_tools/assets_extract.py.
 # Don't modify it manually.

+ 1 - 0
tasks/Orochi/assets.py

@@ -2,6 +2,7 @@ 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
 
 # This file was automatically generated by module/dev_tools/assets_extract.py.
 # Don't modify it manually.

+ 1 - 0
tasks/OrochiJudgement/assets.py

@@ -2,6 +2,7 @@ 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
 
 # This file was automatically generated by module/dev_tools/assets_extract.py.
 # Don't modify it manually.

+ 1 - 0
tasks/OrochiMoans/assets.py

@@ -2,6 +2,7 @@ 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
 
 # This file was automatically generated by module/dev_tools/assets_extract.py.
 # Don't modify it manually.

+ 1 - 0
tasks/RealmRaid/assets.py

@@ -2,6 +2,7 @@ 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
 
 # This file was automatically generated by module/dev_tools/assets_extract.py.
 # Don't modify it manually.

+ 1 - 0
tasks/Restart/assets.py

@@ -2,6 +2,7 @@ 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
 
 # This file was automatically generated by module/dev_tools/assets_extract.py.
 # Don't modify it manually.

+ 1 - 0
tasks/Script/assets.py

@@ -2,6 +2,7 @@ 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
 
 # This file was automatically generated by module/dev_tools/assets_extract.py.
 # Don't modify it manually.

+ 1 - 0
tasks/Sougenbi/assets.py

@@ -2,6 +2,7 @@ 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
 
 # This file was automatically generated by module/dev_tools/assets_extract.py.
 # Don't modify it manually.