Git Product home page Git Product logo

honkaihelper's Introduction

HonkaiHelper

基于图色识别和OCR的PC端崩坏3自动化脚本,先别退坑,刷刷日常凑登录天数吧~

功能

旧版本功能在新版尚未完全实现,会慢慢补充,目前完成每日活跃任务还是够的

  • 挂远征、家园打工
  • 肝万象虚境锻造材料
  • 材料活动一键减负
  • 领家园金币、凭证奖励、邮件、每日活跃奖励
  • 戳老婆
  • 买商店每天金币碎片
  • 领每周一次舰团贡献奖励、时序票、吼姆秘宝
  • 提交舰团委托、领舰团奖励

使用方法

一键包

尝鲜版图形化一键包现已发布,无需配置python环境,但可能有各种奇妙bug,欢迎下载体验。所用的图形化界面DaCapo与本项目完全独立,是一个通用脚本管理器,如果你有其他脚本想放上来,可以自行查看README了解用法。

解压后点击DaCapo.exe启动程序,进入“总览”修改游戏路径,然后回到主页点击按钮即可开始。

从源码构建

  1. 克隆本项目或直接下载压缩包并解压
git clone https://github.com/Aues6uen11Z/HonkaiHelper.git 
  1. 准备Python环境,建议使用conda的新虚拟环境
# 安装完anaconda或miniconda后进入shell
# 理论上支持3.6以上任意版本,但目前只测试了3.9
conda create -n zafkiel python==3.9.18
conda activate zafkiel
  1. 在该环境内安装依赖包
pip install zafkiel pydantic
  1. 到项目根目录下的config/config.json修改游戏启动路径
  2. 在项目根目录运行main.py
cd 你的存储路径/HonkaiHelper
python main.py

注意事项

  1. 项目更新有时会涉及到依赖更新,使用时请确保你的zafkiel版本是最新的

    # 在你的虚拟环境内
    pip install --upgrade zafkiel
  2. 理论上可以在任意16:9的分辨率运行,但我目前开发测试都在1280×720窗口模式,求稳请使用720P。

  3. 目前新版本尚未开发完全,不能保证在每一个人的电脑上都完美运行,出现问题可以在issue中提出,记得附上日志(网页报告暂时不用,还没有整理,有很多无用信息)

Todo

  • 常用功能
  • 图形化界面
  • 安卓模拟器支持
  • 改进日志和网页报告

开发

新版本使用了Zafkiel库,结合了AirtestStarRailCopilot的一些优点,目前还有很多地方需要完善,文档后面有时间了会慢慢补上,有兴趣可以先自行阅读源码。

honkaihelper's People

Contributors

aues6uen11z avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

honkaihelper's Issues

小白一个,看了一个下午都没有解决问题,求大佬解答一下

下面是AirtestIDE控制台的内容:
Info: filter not set, use raven.filter.FullPassFilter instead.
loading config from : C:\Users\star\AppData\Local\AirtestIDE\AirtestIDE\user.json
try loading plugin: firebase_plugin
plugin loaded: firebase_plugin
try loading plugin: headspin_plugin
plugin loaded: headspin_plugin
try loading plugin: selenium_plugin
plugin loaded: selenium_plugin
Traceback (most recent call last):
File "jedi\evaluate\compiled\subprocess_init_.py", line 248, in _send
is_exception, traceback, result = pickle_load(self._process.stdout)
File "jedi_compatibility.py", line 464, in pickle_load
return pickle.load(file, encoding='bytes')
EOFError: Ran out of input

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "jedi\api\environment.py", line 74, in _get_subprocess
info = self._subprocess._send(None, get_info)
File "jedi\evaluate\compiled\subprocess_init
.py", line 260, in _send
stderr,
jedi.api.exceptions.InternalError: The subprocess D:\diandong\Python\python.exe has crashed (EOFError('Ran out of input',), stderr=<empty/not available (ValueError('read of closed file',))>).

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "app\plugins\editor\plugin.py", line 234, in init_jedi_env
File "jedi\api\environment.py", line 302, in create_environment
return Environment(path)
File "jedi\api\environment.py", line 66, in init
self._get_subprocess()
File "jedi\api\environment.py", line 79, in _get_subprocess
exc))
jedi.api.environment.InvalidPythonEnvironment: Could not get version information for 'D:\diandong\Python\python.exe': InternalError("The subprocess D:\diandong\Python\python.exe has crashed (EOFError('Ran out of input',), stderr=<empty/not available (ValueError('read of closed file',))>).",)

[20:13:16][DEBUG]<airtest.core.android.adb> D:\diandong\AirtestIDE\airtest\core\android\static\adb\windows\adb.exe devices

以下是在AirtestIDE运行时报错的内容:
from airtest.cli.parser import cli_setup(错误一)
from airtest.report.report import simple_report
from event import *(错误二)

建议添加一个在崩溃后按下任意键继续的功能

感谢你做的自动化脚本, 我在使用过程中偶尔会遇到些环境相关的bug,如"DLL load failed while importing win32api: 找不到指定的程序"等,
但是在崩溃时错误信息转瞬即逝, 目前我的做法是用录屏软件来录屏逐帧回放查看错误信息再结合搜索引擎debug, 想问一下能不能在非正常退出/崩溃时添加一个按下任意键继续的功能, 方便查看错误信息.

小白提出的提问,关于cannot import name 'evalcontextfilter' from 'jinja2' 的问题

Traceback (most recent call last):
File "D:\Github\HONKAI\HonkaiHelper\main.py", line 8, in
from airtest.cli.parser import cli_setup
File "C:\Users\Mapleleaves\AppData\Local\Programs\Python\Python39\lib\site-packages\airtest\cli\parser.py", line 4, in
from airtest.report.report import get_parger as report_parser
File "C:\Users\Mapleleaves\AppData\Local\Programs\Python\Python39\lib\site-packages\airtest\report\report.py", line 15, in
from jinja2 import evalcontextfilter, Markup, escape
ImportError: cannot import name 'evalcontextfilter' from 'jinja2' (C:\Users\Mapleleaves\AppData\Local\Programs\Python\Python39\lib\site-packages\jinja2_init_.py)

在电脑上尝试部署后出现如下提示,google百度均无果,故提问大佬
小白一个,求大佬不要生气

有一点问题

脚本启动了一会,脚本界面就自动关闭了,崩坏只是签到就没了。

点开任务就闪退了

最开始是全屏,显示识别不到,我就改成1280×720窗口模式,变成闪退了
{F41EBFF4-C4E2-4b27-AF8E-B9D553BCC535}

任务领取界面

1.家园打工界面选择的是第二个派遣任务,而不是第一个
2.活跃奖励领取界面最后会点击一个任务详情,这里应该是要领取活跃奖励的
微信图片_20240405125510

使用问题

使用脚本启动游戏,登录进游戏后,会在舰上不断重复退出游戏->取消->退出游戏->取消,这是为什么呢,分辨率是设置1280×720窗口模式
image
image
就是像图上这样,会不断重复

一直报错

[Start running..]
[2308] Failed to execute script AirtestIDE
Traceback (most recent call last):
File "AirtestIDE.py", line 82, in
File "AirtestIDE.py", line 58, in main
File "app\widgets\code_runner\tracer.py", line 72, in run_pyfile
File "C:\Users\weiwei\Desktop\HonkaiHelper-1f8218c7907c34696ad98697e85b323e22b58c07\main.py", line 8, in
from event import *
ModuleNotFoundError: No module named 'event'
[Finished]

ModuleNotFoundError: No module named 'event'

在Airtest中运行main.py时报错:
"D:\Tools\AirtestIDE\AirtestIDE" pyrunner "C:\Users\winds\Documents\Codes\HonkaiHelper\main.py"
[Start running..]
[16692] Failed to execute script AirtestIDE
Traceback (most recent call last):
File "AirtestIDE.py", line 82, in
File "AirtestIDE.py", line 58, in main
File "app\widgets\code_runner\tracer.py", line 72, in run_pyfile
File "C:\Users\winds\Documents\Codes\HonkaiHelper\main.py", line 11, in
from event import *
ModuleNotFoundError: No module named 'event'
[Finished]
然后在cmd中执行pip install event时报错:
C:\Users\winds\Documents\Codes\HonkaiHelper>pip install event
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting event
Using cached https://pypi.tuna.tsinghua.edu.cn/packages/d7/e9/3f88290f7a6add3e150b04d61cd989d07b0e5394c37f8bbc32d5a2ee263f/event-0.4.3.zip (56 kB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [7 lines of output]
Traceback (most recent call last):
File "", line 2, in
File "", line 34, in
File "C:\Users\winds\AppData\Local\Temp\pip-install-if_500t4\event_fed8eb9d9aba4ff3a2b89fec8b70b6e8\setup.py", line 20
print 'found libevent build directory', best
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print('found libevent build directory', best)?
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
uTools_1650354375202.png
uTools_1650354365368.png
请问要怎么解决呢?

运行错误

修改设置之后,出现下面的错误,该如何解决?
Traceback (most recent call last):
File "E:\A\HonkaiHelper-master\main.py", line 5, in
from airtest.cli.parser import cli_setup
ModuleNotFoundError: No module named 'airtest'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.