diff --git a/config/template.json b/config/template.json index d432b0fe..d08c7838 100644 --- a/config/template.json +++ b/config/template.json @@ -41,7 +41,9 @@ "scheduler": { "enable": false, "next_run": "2023-01-01 00:00:00", - "priority": 3 + "interval_days": 1, + "interval_hours": 0, + "interval_minutes": 0 }, "general_battle": { "lock_team_enable": false, @@ -67,63 +69,101 @@ "scheduler": { "enable": false, "next_run": "2023-01-01 00:00:00", - "priority": 3 + "interval_days": 1, + "interval_hours": 0, + "interval_minutes": 0 } }, "gold_youkai": { "scheduler": { "enable": false, "next_run": "2023-01-01 00:00:00", - "priority": 3 + "interval_days": 1, + "interval_hours": 0, + "interval_minutes": 0 } }, "nian": { "scheduler": { "enable": false, "next_run": "2023-01-01 00:00:00", - "priority": 3 + "interval_days": 1, + "interval_hours": 0, + "interval_minutes": 0 } }, - "orochi": { + "realm_raid": { "scheduler": { "enable": false, "next_run": "2023-01-01 00:00:00", - "priority": 3 + "interval_days": 1, + "interval_hours": 0, + "interval_minutes": 0 + }, + "raid_config": { + "raid_mode": "retreat_four_attack_nine", + "attack_number": "all" + }, + "general_battle_config": { + "lock_team_enable": false, + "preset_enable": false, + "preset_group": 1, + "preset_team": 1, + "buff_enable": false, + "buff_awake_click": false, + "buff_soul_click": false, + "buff_gold_50_click": false, + "buff_gold_100_click": false, + "buff_exp_50_click": false, + "buff_exp_100_click": false, + "green_enable": false, + "green_mark": "green_left1", + "random_click_swipt_enable": false } }, - "orochi_moans": { + "orochi": { "scheduler": { "enable": false, "next_run": "2023-01-01 00:00:00", - "priority": 3 + "interval_days": 1, + "interval_hours": 0, + "interval_minutes": 0 } }, - "orochi_judgement": { + "orochi_moans": { "scheduler": { "enable": false, "next_run": "2023-01-01 00:00:00", - "priority": 3 + "interval_days": 1, + "interval_hours": 0, + "interval_minutes": 0 } }, "sougenbi": { "scheduler": { "enable": false, "next_run": "2023-01-01 00:00:00", - "priority": 3 + "interval_days": 1, + "interval_hours": 0, + "interval_minutes": 0 } }, "fallen_sun": { "scheduler": { "enable": false, "next_run": "2023-01-01 00:00:00", - "priority": 3 + "interval_days": 1, + "interval_hours": 0, + "interval_minutes": 0 } }, "eternity_sea": { "scheduler": { "enable": false, "next_run": "2023-01-01 00:00:00", - "priority": 3 + "interval_days": 1, + "interval_hours": 0, + "interval_minutes": 0 } } } \ No newline at end of file diff --git a/module/config/config_model.py b/module/config/config_model.py index f564de2b..764062b6 100644 --- a/module/config/config_model.py +++ b/module/config/config_model.py @@ -19,7 +19,6 @@ from tasks.Nian.config import Nian from tasks.Orochi.config import Orochi from tasks.OrochiMoans.config import OrochiMoans -from tasks.OrochiJudgement.config import OrochiJudgement from tasks.Sougenbi.config import Sougenbi from tasks.FallenSun.config import FallenSun from tasks.EternitySea.config import EternitySea @@ -45,7 +44,6 @@ class ConfigModel(BaseModel): # 这些是刷御魂的 orochi: Orochi = Field(default_factory=Orochi) orochi_moans: OrochiMoans = Field(default_factory=OrochiMoans) - orochi_judgement: OrochiJudgement = Field(default_factory=OrochiJudgement) sougenbi: Sougenbi = Field(default_factory=Sougenbi) fallen_sun: FallenSun = Field(default_factory=FallenSun) eternity_sea: EternitySea = Field(default_factory=EternitySea) diff --git a/module/config/i18n/zh_CN.qm b/module/config/i18n/zh_CN.qm index 58ab60c8..2a9d82bd 100644 Binary files a/module/config/i18n/zh_CN.qm and b/module/config/i18n/zh_CN.qm differ diff --git a/module/config/i18n/zh_CN.ts b/module/config/i18n/zh_CN.ts index 322ba846..86d0bbfd 100644 --- a/module/config/i18n/zh_CN.ts +++ b/module/config/i18n/zh_CN.ts @@ -73,27 +73,27 @@ Locale 语言环境 - + Dpi Strategy 分辨率DPI缩放策略 - + default 默认不缩放 - + floor 始终不缩放 - + ceil 始终缩放 - + round 设备像素比0.5及以上的,进行缩放 - + round_prefer_floor 设备像素比0.75及以上的,进行缩放 @@ -126,93 +126,235 @@ Update 更新 - + Overview 总览 - + Script 脚本 - + General 通用 - + Restart 重启 - + Tools 工具 - + Image Rule 截图规范 - + Ocr Rule OCR规范 - + Click Rule 点击规范 - + Long Click Rule 长按规范 - + Swipe Rule 滑动规范 - + Daily Task 日常任务 - + AreaBoss 地狱鬼王 - + GoldYoukai 金币妖怪 - + ExperienceYoukai 经验妖怪 - + Nian 年兽 - + Soul Zones 御魂副本 - + Orochi 八岐大蛇 - + OrochiMoans 御魂悲鸣 - + OrochiJudgement 御魂神罚 - + Sougenbi 业原火 - + FallenSun 日轮之城 - + EternitySea 永生之海 + + GlobalGame + 全局游戏设置 + + + RealmRaid + 个人突破 + + + List Rule + 列表规则 + + + + Args + + Setting + 设置 + + + Device + 模拟器 + + + Serial + 模拟器 Serial + + + Handle + 句柄 Handle + + + package_name_help + 模拟器上装有多个游戏客户端时,需要手动选择服务器 + + PackageName游戏客户端 + ScreenshotMethod模拟器截屏方案 + ControlMethod模拟器控制方案 + + serial_help + 常见的模拟器 Serial 可以查询下方列表 +填 "auto" 自动检测模拟器,多个模拟器正在运行或使用不支持自动检测的模拟器时无法使用 "auto",必须手动填写 + +模拟器默认 Serial: +[MuMu模拟器12]: 127.0.0.1:16384 +[MuMu模拟器]: 127.0.0.1:7555 +[雷电模拟器](全系列通用): emulator-5554 或 127.0.0.1:5555 + +如果没有提及的那可能是还没有测试或者不推荐使用,可以自行尝试 +如果你使用了模拟器的多开功能,它们的 Serial 将不是默认的,可以在 console.bat 中执行 `adb devices` 查询,或根据模拟器官方的教程填写' + + + handle_help + 填 "auto" 自动检测模拟器,多个模拟器正在运行或使用不支持自动检测的模拟器时无法使用 "auto",必须手动填写 +输入为句柄标题或者是句柄号,每次启动模拟器时句柄号会变化 + +句柄标题 Handle: +[MuMu模拟器12]: "MuMu模拟器12" +[MuMu模拟器]: "MuMu模拟器" "\n" +[雷电模拟器](全系列通用): "雷电模拟器" + +句柄号 Handle: +!!!占位符 + + + screenshot_method_help + 目前只支持window_background, 其他还未完整的测试 + + + control_method_help + 目前只支持window_message, 其他还未完整的测试 + + + Adb Restart + 在检测不到设备的时候尝试重启adb + + Error出错 + Handle Error启用异常处理 + handle_error_help处理部分异常,运行出错时撤退 + Save Error出错时,保存 Log 和截图 + Screenshot Length出错时,保留最后 X 张截图 + Optimization优化 + Screenshot Interval放慢截图速度至 X 秒一张 + Combat Screenshot Interval战斗中放慢截图速度至 X 秒一张 + Task Hoarding Duration囤积任务 X 分钟 + WhenTaskQueueEmpty当任务队列清空后 + screenshot_interval_help执行两次截图之间的最小间隔,限制在 0.1 ~ 0.3,对于高配置电脑能降低 CPU 占用 + combat_screenshot_interval_help执行两次截图之间的最小间隔,限制在 0.1 ~ 1.0,能降低战斗时的 CPU 占用 + task_hoarding_duration_help能在收菜期间降低操作游戏的频率,任务触发后,等待 X 分钟,再一次性执行囤积的任务 + when_task_queue_empty_help无任务时关闭游戏,能在收菜期间降低 CPU 占用 + + + Args + Scheduler任务调度 + Enable启用该功能 + Next Run下一次运行时间 + Priority任务优先级 + Interval Days下次执行的间隔天数 + Interval Hours下次执行的间隔小时 + Interval Minutes下次执行的间隔分钟 + enable_help将这个任务加入调度器 + next_run_help会根据下面的间隔时间自动计算时间,清空后回车即可设置为当前 + priority_help如果设置调度规则为基于优先级,则该选项有效 +默认为5,数字越低优先级越高,可取[1~15],如果同优先级,则按照先来后到规则进行调度 + interval_days_help可取[0~7] + interval_hours_help可取[0~24] + interval_minutes_help可取[0~60] + + + Args + GeneralBattleConfig通用战斗 + Lock Team Enable锁定阵容 + Preset Enable启用切换预设队伍 + Preset Group第 X 个预设组 + Preset Team第 X 个预设队伍 + Buff Enable启用加成 + Buff Awake Click开启觉醒加成 + Buff Soul Click开启御魂加成 + Buff Gold 50 Click开启金币加成50% + Buff Gold 100 Click开启金币加成100% + Buff Exp 50 Click开启经验加成50% + Buff Exp 100 Click开启金币加成100% + Green Enable启用我方绿标 + GreenMarkType设置第 X 个式神为绿标 + Random Click Swipt Enable战斗时随机点击或者随机滑动 + + lock_team_enable_help如果锁定阵容将无法启用预设队伍、加成功能 + preset_enable_help + preset_group_help可选[1~7] + preset_team_help可选[1~5] + buff_enable_help在准备阶段开启加成不太符合直觉,暂时还未实现,而且挺多的战斗是不允许准备阶段开启加成的 + green_enable_help在战斗开始的一瞬间点击绿标,无反馈点击 + green_mark_help可选[左一, 左二, 左三, 左四, 左五, 主阴阳师] + random_click_swipt_enable_help防封优化,每三分钟的战斗可能触发2~5次,请注意这个与绿标功能冲突,可能会乱点绿标 + + + Args + Boss Number挑战鬼王数量 + RaidConfig个人突破 + RaidMode挑战模式 + AttackNumber挑战次数 + raid_mode_help默认为退四打九,退四打九指每次执行前都会退出四次,然后在进攻九次 diff --git a/module/gui/qml/Component/Args.qml b/module/gui/qml/Component/Args.qml index 21738de5..8c7f8fb5 100644 --- a/module/gui/qml/Component/Args.qml +++ b/module/gui/qml/Component/Args.qml @@ -160,7 +160,7 @@ Item { wrapMode: Text.WrapAnywhere topPadding: 6 } - FluCopyableText{ + FluText{ id: string_description anchors{ top: string_title.bottom @@ -169,7 +169,8 @@ Item { width: string_title.width text: "" font: FluTextStyle.Caption - wrapMode: Text.WrapAnywhere + wrapMode: Text.WordWrap +// textFormat: Text.PlainText topPadding: 6 rightPadding: 6 } @@ -184,11 +185,11 @@ Item { //判断是不是时间类型的变量2023-01-01 stringItem.isDateTime = true } - string_title.text = modelData.title + string_title.text = qsTr(modelData.title) if( typeof modelData.description === 'undefined'){ return } - string_description.text = modelData.description + string_description.text = qsTr(modelData.description.replace("\\n","\n")) } } } @@ -228,7 +229,7 @@ Item { wrapMode: Text.WrapAnywhere topPadding: 6 } - FluCopyableText{ + FluText{ id: itemArg_description anchors{ top: itemArg_title.bottom @@ -238,6 +239,7 @@ Item { text: "" font: FluTextStyle.Caption wrapMode: Text.WrapAnywhere +// textFormat: Text.PlainText topPadding: 6 rightPadding: 6 } @@ -248,11 +250,11 @@ Item { } itemArg_text.text = modelData.value itemArg_text.placeholderText = modelData["default"] - itemArg_title.text = modelData.title + itemArg_title.text = qsTr(modelData.title) if( typeof modelData.description === 'undefined'){ return } - itemArg_description.text = modelData.description + itemArg_description.text = qsTr(modelData.description) } } } @@ -292,7 +294,7 @@ Item { wrapMode: Text.WrapAnywhere topPadding: 6 } - FluCopyableText{ + FluText{ id: itemArg_description anchors{ top: itemArg_title.bottom @@ -302,6 +304,7 @@ Item { text: "" font: FluTextStyle.Caption wrapMode: Text.WrapAnywhere +// textFormat: Text.PlainText topPadding: 6 rightPadding: 6 } @@ -312,11 +315,11 @@ Item { } itemArg_text.text = modelData.value itemArg_text.placeholderText = modelData["default"] - itemArg_title.text = modelData.title + itemArg_title.text = qsTr(modelData.title) if( typeof modelData.description === 'undefined'){ return } - itemArg_description.text = modelData.description + itemArg_description.text = qsTr(modelData.description) } } } @@ -357,7 +360,7 @@ Item { wrapMode: Text.WrapAnywhere topPadding: 6 } - FluCopyableText{ + FluText{ id: itemArg_description anchors{ top: itemArg_title.bottom @@ -376,11 +379,11 @@ Item { return } itemArg_text.selected = modelData.value - itemArg_title.text = modelData.title + itemArg_title.text = qsTr(modelData.title) if( typeof modelData.description === 'undefined'){ return } - itemArg_description.text = modelData.description + itemArg_description.text = qsTr(modelData.description) } } } @@ -420,7 +423,7 @@ Item { wrapMode: Text.WrapAnywhere topPadding: 6 } - FluCopyableText{ + FluText{ id: itemArg_description anchors{ top: itemArg_title.bottom @@ -430,6 +433,7 @@ Item { text: "" font: FluTextStyle.Caption wrapMode: Text.WrapAnywhere +// textFormat: Text.PlainText topPadding: 6 rightPadding: 6 } @@ -440,11 +444,11 @@ Item { } itemArg_text.model = modelData.options itemArg_text.show(modelData.value) - itemArg_title.text = modelData.title + itemArg_title.text = qsTr(modelData.title) if( typeof modelData.description === 'undefined'){ return } - itemArg_description.text = modelData.description + itemArg_description.text = qsTr(modelData.description) } } } @@ -499,7 +503,7 @@ Item { const object = group_item.createObject(contentScrollable) if(object !== null){ object.groupName = groupName - object.groupTitle = groupTitle + object.groupTitle = qsTr(groupTitle) object.argumentValue = argumentValue contentScrollable.content.push(object) diff --git a/script.py b/script.py index 7b7cfca9..08bc6799 100644 --- a/script.py +++ b/script.py @@ -87,7 +87,7 @@ def save_error_log(self): from module.base.utils import save_image from module.handler.sensitive_info import (handle_sensitive_image, handle_sensitive_logs) - if self.config.Error_SaveError: + if self.config.script.error.save_error: if not os.path.exists('./log/error'): os.mkdir('./log/error') folder = f'./log/error/{int(time.time() * 1000)}' diff --git a/tasks/AreaBoss/config_boss.py b/tasks/AreaBoss/config_boss.py index 576a6a08..1f6069b2 100644 --- a/tasks/AreaBoss/config_boss.py +++ b/tasks/AreaBoss/config_boss.py @@ -8,5 +8,5 @@ class Boss(BaseModel): boss_number: int = Field(title='Boss Number', default=3, - description='[Boss数量]:默认为3\n 可选[1-3]', + description='默认为3 可选[1-3]', ge=1, le=3) diff --git a/tasks/Component/GeneralBattle/config_general_battle.py b/tasks/Component/GeneralBattle/config_general_battle.py index 17215c30..f9238020 100644 --- a/tasks/Component/GeneralBattle/config_general_battle.py +++ b/tasks/Component/GeneralBattle/config_general_battle.py @@ -16,35 +16,35 @@ class GreenMarkType(str, Enum): class GeneralBattleConfig(BaseModel): # 是否锁定阵容, 有些的战斗是外边的锁定阵容甚至有些的战斗没有锁定阵容的 - lock_team_enable: bool = Field(default=False, description='[锁定阵容]:默认为False \n如果锁定阵容将无法启用预设队伍、加成功能') + lock_team_enable: bool = Field(default=False, description='lock_team_enable_help') # 是否启动 预设队伍 - preset_enable: bool = Field(default=False, description='[启用预设]:默认为False') + preset_enable: bool = Field(default=False, description='preset_enable_help') # 选哪一个预设组 - preset_group: int = Field(default=1, description='[设置预设组]:默认为1, 可选[1-7]', ge=1, le=7) + preset_group: int = Field(default=1, description='preset_group_help', ge=1, le=7) # 选哪一个队伍 - preset_team: int = Field(default=1, description='[设置预设队伍]:默认为1, 可选[1-5]', ge=1, le=5) + preset_team: int = Field(default=1, description='preset_team_help', ge=1, le=5) # 是否启动开启buff - buff_enable: bool = Field(default=False, description='[启用加成]:默认为False') + buff_enable: bool = Field(default=False, description='buff_enable_help') # 是否点击觉醒Buff - buff_awake_click: bool = Field(default=False, description='[觉醒加成]:默认为False') + buff_awake_click: bool = Field(default=False, description='') # 是否点击御魂buff - buff_soul_click: bool = Field(default=False, description='[御魂加成]:默认为False') + buff_soul_click: bool = Field(default=False, description='') # 是否点击金币50buff - buff_gold_50_click: bool = Field(default=False, description='[金币50加成]:默认为False') + buff_gold_50_click: bool = Field(default=False, description='') # 是否点击金币100buff - buff_gold_100_click: bool = Field(default=False, description='[金币100加成]:默认为False') + buff_gold_100_click: bool = Field(default=False, description='') # 是否点击经验50buff - buff_exp_50_click: bool = Field(default=False, description='[经验50加成]:默认为False') + buff_exp_50_click: bool = Field(default=False, description='') # 是否点击经验100buff - buff_exp_100_click: bool = Field(default=False, description='[经验100加成]:默认为False') + buff_exp_100_click: bool = Field(default=False, description='') # 是否开启绿标 - green_enable: bool = Field(default=False, description='[启用绿标]:默认为False') + green_enable: bool = Field(default=False, description='green_enable_help') # 选哪一个绿标 - green_mark: GreenMarkType = Field(default=GreenMarkType.GREEN_LEFT1, description='[设置绿标]:默认为左一 \n可选[左一, 左二, 左三, 左四, 左五, 主阴阳师]') + green_mark: GreenMarkType = Field(default=GreenMarkType.GREEN_LEFT1, description='green_mark_help') # 是否启动战斗时随机点击或者随机滑动 - random_click_swipt_enable: bool = Field(default=False, description='[战斗时随机点击或滑动]:默认为False \n防封优化,请注意这个与绿标功能冲突,可能会乱点绿标') + random_click_swipt_enable: bool = Field(default=False, description='random_click_swipt_enable_help') diff --git a/tasks/Component/GeneralInvite/assets.py b/tasks/Component/GeneralInvite/assets.py new file mode 100644 index 00000000..0c7ee47b --- /dev/null +++ b/tasks/Component/GeneralInvite/assets.py @@ -0,0 +1,12 @@ +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 module/dev_tools/assets_extract.py. +# Don't modify it manually. +class GeneralInviteAssets: + pass + diff --git a/tasks/Component/config_scheduler.py b/tasks/Component/config_scheduler.py index 5dc077e1..0bcff573 100644 --- a/tasks/Component/config_scheduler.py +++ b/tasks/Component/config_scheduler.py @@ -6,16 +6,16 @@ from pydantic import BaseModel, ValidationError, validator, Field class Scheduler(BaseModel): - enable: bool = Field(default=False, description='[是否启用]:默认为False') - next_run: datetime = Field(default="2023-01-01 00:00:00", description='[下次执行时间]:默认为2023-01-01 00:00:00\n 清空后回车设置当前的时间') - interval_days: int = Field(default=1, description='[间隔天数]:默认为1\n 可选0-7') - interval_hours: int = Field(default=0, description='[间隔小时]:默认为0\n 可选0-23') - interval_minutes: int = Field(default=0, description='[间隔分钟]:默认为0\n 可选0-59') + enable: bool = Field(default=False, description='enable_help') + next_run: datetime = Field(default="2023-01-01 00:00:00", description='next_run_help') + priority: int = Field(default=5, description='priority_help') + interval_days: int = Field(default=1, description='interval_days_help') + interval_hours: int = Field(default=0, description='interval_hours_help') + interval_minutes: int = Field(default=0, description='interval_minutes_help') @validator('next_run', pre=True, always=True) def parse_next_run(cls, value): if isinstance(value, str): - print('parse_next_run') try: return datetime.fromisoformat(value) except ValueError: diff --git a/tasks/GameUi/game_ui.py b/tasks/GameUi/game_ui.py index e0a77ca9..e8a4d210 100644 --- a/tasks/GameUi/game_ui.py +++ b/tasks/GameUi/game_ui.py @@ -5,8 +5,6 @@ from tasks.GameUi.assets import GameUiAssets from tasks.base_task import BaseTask -from tasks.GeneralBattle.general_battle import GeneralBattle -from tasks.AreaBoss.assets import AreaBossAssets from module.logger import logger diff --git a/tasks/RealmRaid/assets.py b/tasks/RealmRaid/assets.py index 71988ca9..2c182d1a 100644 --- a/tasks/RealmRaid/assets.py +++ b/tasks/RealmRaid/assets.py @@ -45,6 +45,8 @@ class RealmRaidAssets: I_UNLOCK_2 = RuleImage(roi_front=(1002,643,30,41), roi_back=(1002,643,30,41), threshold=0.9, method="Template matching", file="./tasks/RealmRaid/res/res_unlock_2.png") # 以锁图片,适配呱太 I_LOCK_2 = RuleImage(roi_front=(1002,645,34,38), roi_back=(1002,645,34,38), threshold=0.9, method="Template matching", file="./tasks/RealmRaid/res/res_lock_2.png") + # description + I_MEDAL_5_FROG = RuleImage(roi_front=(903,479,201,49), roi_back=(189,182,967,376), threshold=0.8, method="Template matching", file="./tasks/RealmRaid/res/res_medal_5_frog.png") # Ocr Rule Assets diff --git a/tasks/RealmRaid/config.py b/tasks/RealmRaid/config.py index 69e2d7b0..8cd2c12f 100644 --- a/tasks/RealmRaid/config.py +++ b/tasks/RealmRaid/config.py @@ -18,9 +18,9 @@ class AttackNumber(str, Enum): class RaidConfig(BaseModel): raid_mode: RaidMode = Field(title='Raid Mode', default=RaidMode.NORMAL, - description='[挑战模式]:默认为退四打九\n 退四打九指每次执行前都会退出四次,然后在进攻九次') + description='raid_mode_help') attack_number: AttackNumber = Field(title='Attack Number', default=AttackNumber.ALL, - description='[挑战次数]:默认为all,一直打到没有\n nine为打九次') + description='') class RealmRaid(BaseModel): scheduler: Scheduler = Field(default_factory=Scheduler) diff --git a/tasks/RealmRaid/res/image.json b/tasks/RealmRaid/res/image.json index a8003d1b..9d33d8e2 100644 --- a/tasks/RealmRaid/res/image.json +++ b/tasks/RealmRaid/res/image.json @@ -151,5 +151,14 @@ "method": "Template matching", "threshold": 0.9, "description": "以锁图片,适配呱太" + }, + { + "itemName": "medal_5_frog", + "imageName": "res_medal_5_frog.png", + "roiFront": "903,479,201,49", + "roiBack": "189,182,967,376", + "method": "Template matching", + "threshold": 0.8, + "description": "description" } ] \ No newline at end of file diff --git a/tasks/RealmRaid/res/res_medal_5_frog.png b/tasks/RealmRaid/res/res_medal_5_frog.png new file mode 100644 index 00000000..f5890450 Binary files /dev/null and b/tasks/RealmRaid/res/res_medal_5_frog.png differ diff --git a/tasks/RealmRaid/script_task.py b/tasks/RealmRaid/script_task.py index ee522afd..f939ed4e 100644 --- a/tasks/RealmRaid/script_task.py +++ b/tasks/RealmRaid/script_task.py @@ -100,6 +100,7 @@ def medal_fire(self) -> bool: :return: """ # 点击勋章的挑战 和挑战 + time.sleep(0.2) is_click = False while 1: self.screenshot() @@ -118,6 +119,9 @@ def medal_fire(self) -> bool: if is_click: continue + if self.appear_then_click(self.I_MEDAL_5_FROG, interval=1.5): + is_click = True + continue if self.appear_then_click(self.I_MEDAL_5, interval=1.5): is_click = True continue diff --git a/tasks/Script/config_device.py b/tasks/Script/config_device.py index 153aa81c..8b1bac72 100644 --- a/tasks/Script/config_device.py +++ b/tasks/Script/config_device.py @@ -28,17 +28,18 @@ class ControlMethod(str, Enum): class Device(BaseModel): serial: str = Field(default="auto", - description='Common emulator Serial can be queried in the list belowUse "auto" to auto-detect emulators, but if multiple emulators are running or use emulators that do not support auto-detect, "auto" cannot be used and serial must be filled in manually') + description='serial_help') handle: str = Field(default='auto', - description='you can use auto or your emulator title') - package_name: PackageName = Field(default=PackageName.AUTO, - description='package name') + description='handle_help') + package_name: PackageName = Field(title='Package Name', + default=PackageName.AUTO, + description='package_name_help') screenshot_method: ScreenshotMethod = Field(default=ScreenshotMethod.WINDOW_BACKGROUND, - description='only support window') + description='screenshot_method_help') control_method: ControlMethod = Field(default=ControlMethod.WINDOW_MESSAGE, - description='only support window') + description='control_method_help') adb_restart: bool = Field(default=False, - description='') + description='adb_restart_help') diff --git a/tasks/Script/config_error.py b/tasks/Script/config_error.py index 0e4b9502..43e07316 100644 --- a/tasks/Script/config_error.py +++ b/tasks/Script/config_error.py @@ -8,8 +8,10 @@ class Error(BaseModel): handle_error: bool = Field(default=False, - description='none') + description='handle_error_help') save_error: bool = Field(default=False, - description='none') + description='') screenshot_length: int = Field(default=1, - description='The number of recent screenshots to save when something goes wrong') \ No newline at end of file + description='') + + diff --git a/tasks/Script/config_optimization.py b/tasks/Script/config_optimization.py index e61fc970..6ce53811 100644 --- a/tasks/Script/config_optimization.py +++ b/tasks/Script/config_optimization.py @@ -12,10 +12,11 @@ class WhenTaskQueueEmpty(str, Enum): class Optimization(BaseModel): screenshot_interval: float = Field(default=0.3, - description='none') + description='screenshot_interval_help') combat_screenshot_interval: float = Field(default=1.0, - description='none') + description='combat_screenshot_interval_help') task_hoarding_duration: float = Field(default=0, - description='none') + description='task_hoarding_duration_help') when_task_queue_empty: WhenTaskQueueEmpty = Field(default=WhenTaskQueueEmpty.GOTO_HOME, - description='you can select goto home where nothing to do') \ No newline at end of file + description='when_task_queue_empty_help') + diff --git a/tasks/base_task.py b/tasks/base_task.py index 3bc98e6d..08da9730 100644 --- a/tasks/base_task.py +++ b/tasks/base_task.py @@ -370,6 +370,7 @@ def set_next_run(self, task: str, finish: bool = False) -> None: hours=task_object.scheduler.interval_hours, minutes=task_object.scheduler.interval_minutes, ) next_run = start_time + delta + next_run.replace(microsecond=0) task_object.scheduler.next_run = next_run self.config.save()