Skip to content

Commit 5af14d8

Browse files
committed
Merge branch 'main' of github.com:MaaAssistantArknights/MAABH3
2 parents b3a7872 + 960fe03 commit 5af14d8

File tree

6 files changed

+308
-8
lines changed

6 files changed

+308
-8
lines changed

tools/CombatGenerator/README.md

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,39 @@
11
# CombatGenerator
22

3+
## 环境
4+
5+
需要 `python` 环境
6+
7+
## 依赖
8+
9+
### ⚠️在.tools/CombatGenerator目录下执行所有命令
10+
11+
(如果已经安装过pipx和pdm可以跳过直接使用pdm install)
12+
13+
```shell
14+
python -m pip install pipx
15+
pipx ensurepath
16+
```
17+
18+
重启终端
19+
20+
```shell
21+
pipx install pdm
22+
pdm install
23+
```
24+
325
## 使用
426

5-
cd path/to/CombatGenerator
6-
pip install pipx
7-
pipx ensurepath
8-
pipx install pdm
9-
pdm install
27+
输入文件需预先保存到 `.tools/CombatGenerator/data/` 路径下,
28+
产物如果没有使用可选参数将会使用默认值保存在 `.tools/CombatGenerator/data/output.json` 路径下
29+
30+
打开cmd, 执行以下命令
1031

11-
重启终端后,直接运行`CombatGenerator``__init__.py`即可。
32+
```shell
33+
.venv\Scripts\Activate.ps1
34+
cd src/combatgenerator
35+
pdm run python __init__.py
36+
```
1237

1338
## 可选参数
1439

@@ -28,7 +53,7 @@
2853

2954
例如我想使用反序列器,传入路径为F:/1.json, 输出路径为F:/2.json
3055

31-
python __init__.py -r -i F:/1.json -o F:/2.json
56+
pdm run python __init__.py -r -i F:/1.json -o F:/2.json
3257

3358
## input说明
3459

tools/CropRoi/.gitignore

Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
### Python template
2+
# Byte-compiled / optimized / DLL files
3+
__pycache__/
4+
*.py[cod]
5+
*$py.class
6+
7+
# C extensions
8+
*.so
9+
10+
# Distribution / packaging
11+
.Python
12+
build/
13+
develop-eggs/
14+
dist/
15+
downloads/
16+
eggs/
17+
.eggs/
18+
lib/
19+
lib64/
20+
parts/
21+
sdist/
22+
var/
23+
wheels/
24+
share/python-wheels/
25+
*.egg-info/
26+
.installed.cfg
27+
*.egg
28+
MANIFEST
29+
30+
# PyInstaller
31+
# Usually these files are written by a python script from a template
32+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
33+
*.manifest
34+
*.spec
35+
36+
# Installer logs
37+
pip-log.txt
38+
pip-delete-this-directory.txt
39+
40+
# Unit test / coverage reports
41+
htmlcov/
42+
.tox/
43+
.nox/
44+
.coverage
45+
.coverage.*
46+
.cache
47+
nosetests.xml
48+
coverage.xml
49+
*.cover
50+
*.py,cover
51+
.hypothesis/
52+
.pytest_cache/
53+
cover/
54+
55+
# Translations
56+
*.mo
57+
*.pot
58+
59+
# Django stuff:
60+
*.log
61+
local_settings.py
62+
db.sqlite3
63+
db.sqlite3-journal
64+
65+
# Flask stuff:
66+
instance/
67+
.webassets-cache
68+
69+
# Scrapy stuff:
70+
.scrapy
71+
72+
# Sphinx documentation
73+
docs/_build/
74+
75+
# PyBuilder
76+
.pybuilder/
77+
target/
78+
79+
# Jupyter Notebook
80+
.ipynb_checkpoints
81+
82+
# IPython
83+
profile_default/
84+
ipython_config.py
85+
86+
# pyenv
87+
# For a library or package, you might want to ignore these files since the code is
88+
# intended to run in multiple environments; otherwise, check them in:
89+
# .python-version
90+
91+
# pipenv
92+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
93+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
94+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
95+
# install all needed dependencies.
96+
#Pipfile.lock
97+
98+
# poetry
99+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
100+
# This is especially recommended for binary packages to ensure reproducibility, and is more
101+
# commonly ignored for libraries.
102+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
103+
#poetry.lock
104+
105+
# pdm
106+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
107+
#pdm.lock
108+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
109+
# in version control.
110+
# https://pdm.fming.dev/#use-with-ide
111+
.pdm.toml
112+
.pdm-python
113+
114+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
115+
__pypackages__/
116+
117+
# Celery stuff
118+
celerybeat-schedule
119+
celerybeat.pid
120+
121+
# SageMath parsed files
122+
*.sage.py
123+
124+
# Environments
125+
.env
126+
.venv
127+
env/
128+
venv/
129+
ENV/
130+
env.bak/
131+
venv.bak/
132+
133+
# Spyder project settings
134+
.spyderproject
135+
.spyproject
136+
137+
# Rope project settings
138+
.ropeproject
139+
140+
# mkdocs documentation
141+
/site
142+
143+
# mypy
144+
.mypy_cache/
145+
.dmypy.json
146+
dmypy.json
147+
148+
# Pyre type checker
149+
.pyre/
150+
151+
# pytype static type analyzer
152+
.pytype/
153+
154+
# Cython debug symbols
155+
cython_debug/
156+
157+
# PyCharm
158+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
159+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
160+
# and can be added to the global gitignore or merged into this file. For a more nuclear
161+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
162+
#.idea/
163+

tools/CropRoi/README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# 截图工具
2+
3+
## 环境
4+
5+
需要 `python` 环境
6+
7+
## 依赖
8+
9+
在./tools/CropRoi下执行以下命令
10+
11+
(如果已经安装过pipx和pdm可以跳过直接使用pdm install)
12+
13+
```shell
14+
python -m pip install pipx
15+
pipx ensurepath
16+
```
17+
18+
重启终端
19+
20+
```shell
21+
pipx install pdm
22+
pdm install
23+
```
24+
25+
## 使用
26+
27+
截图需预先保存到 `./src/` 路径下, 产物将会保存在 `./dst/` 路径下
28+
29+
打开cmd, 执行以下命令
30+
31+
```shell
32+
.venv\Scripts\Activate.ps1
33+
pdm run python main.py
34+
```
35+
36+
在弹出窗口中使用鼠标左键画框, `s` 键保存, `q` 键退出

tools/CropRoi/pdm.lock

Lines changed: 60 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tools/CropRoi/pyproject.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
[project]
3+
# PEP 621 project metadata
4+
# See https://www.python.org/dev/peps/pep-0621/
5+
dependencies = [
6+
"opencv-python>=4.5.3",
7+
]
8+
requires-python = ">=3.11"
9+
10+
[build-system]
11+
requires = ["pdm-backend"]
12+
build-backend = "pdm.backend"

tools/CropRoi/requirements.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
opencv-python~=4.5.3
1+
# This file is @generated by PDM.
2+
# Please do not edit it manually.
3+
4+
numpy==1.26.2
5+
opencv-python==4.8.1.78

0 commit comments

Comments
 (0)