Skip to content

Commit

Permalink
拾取声骸添加是否使用ocr选项
Browse files Browse the repository at this point in the history
  • Loading branch information
ok-oldking committed Jul 25, 2024
1 parent b2bcf9d commit 4a4c0c5
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 4 deletions.
9 changes: 9 additions & 0 deletions i18n/en_US/LC_MESSAGES/ok.po
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,12 @@ msgstr ""

msgid "Auto Pick Flowers in Game World"
msgstr ""

msgid "Pick Echo Config"
msgstr ""

msgid "Turn on if your CPU is Powerful for more accuracy"
msgstr ""

msgid "Use OCR"
msgstr ""
Binary file modified i18n/zh_CN/LC_MESSAGES/ok.mo
Binary file not shown.
15 changes: 12 additions & 3 deletions i18n/zh_CN/LC_MESSAGES/ok.po
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
#
msgid ""
msgstr ""

msgid ""
msgstr ""
"Project-Id-Version: 1.0\n"
Expand All @@ -12,6 +9,9 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

msgid ""
msgstr ""

msgid "(1-6) Important, Choose which level to farm, lower levels might not produce a echo"
msgstr "(1-6) 重要, 选择你对应世界等级可以产出声骸的难度, 从上到下为1-6"

Expand Down Expand Up @@ -125,3 +125,12 @@ msgstr "自动拾取"

msgid "Auto Pick Flowers in Game World"
msgstr "大世界自动拾取"

msgid "Pick Echo Config"
msgstr "拾取声骸"

msgid "Turn on if your CPU is Powerful for more accuracy"
msgstr "高配置CPU请打开,增加拾取声骸准确度,如果配置不够导致路过不捡声骸,请关闭"

msgid "Use OCR"
msgstr "使用文字识别(中英文客户端适用)"
9 changes: 8 additions & 1 deletion src/task/BaseWWTask.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
import re

from ok.config.ConfigOption import ConfigOption
from ok.feature.FindFeature import FindFeature
from ok.logging.Logger import get_logger
from ok.ocr.OCR import OCR
from ok.task.BaseTask import BaseTask

logger = get_logger(__name__)

pick_echo_config_option = ConfigOption('Pick Echo Config', {
'Use OCR': False
}, config_description={
'Use OCR': 'Turn on if your CPU is Powerful for more accuracy'})


class BaseWWTask(BaseTask, FindFeature, OCR):

def __init__(self):
super().__init__()
self.pick_echo_config = self.get_config(pick_echo_config_option)

@property
def absorb_echo_text(self):
if self.game_lang == 'zh_CN' or self.game_lang == 'en_US':
if self.pick_echo_config.get('Use OCR') and (self.game_lang == 'zh_CN' or self.game_lang == 'en_US'):
return re.compile(r'(吸收|Absorb)')
else:
return None
Expand Down

0 comments on commit 4a4c0c5

Please sign in to comment.