Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
5d51eb1
fix(Kikkai): Expand the scope of recognition and add button of close …
BluettDream Oct 25, 2025
2dedde2
fix(Bondling): The queue parameter is abnormal
BluettDream Oct 25, 2025
03de30f
fix(ExperienceYoukai): cannot create room
BluettDream Oct 25, 2025
4358719
fix(RyouToppa): muti-times click area1
BluettDream Oct 25, 2025
9db6e29
fix(Restart): harvest mail
BluettDream Oct 22, 2025
4a88742
fix(DailyTrifiles): harvest gift sign
BluettDream Oct 22, 2025
b2ec475
fix(Updater): local branch not show
BluettDream Oct 25, 2025
42dc6a1
add(ScriptRouter): copy task and task argument interface
BluettDream Oct 25, 2025
46e8321
refactor(Kekkai): custom harvest guild assets times
BluettDream Oct 25, 2025
915b334
fix(Restart): auto cancel continue battle
BluettDream Oct 26, 2025
138d7e1
feat(): Add docker and adapt to the linux system
runhey Oct 26, 2025
2301126
feat(): Add docker and adapt to the linux system
runhey Oct 26, 2025
5ff7808
Merge pull request #1199 from BluettDream/dev_fix_restart
runhey Oct 26, 2025
d0b16b5
Merge pull request #1198 from BluettDream/dev_feat_kekkai
runhey Oct 26, 2025
0ab74a6
Merge pull request #1197 from BluettDream/dev_feat_router
runhey Oct 26, 2025
3998091
Merge pull request #1196 from BluettDream/dev_fix_updater
runhey Oct 26, 2025
4eebe8f
Merge pull request #1195 from BluettDream/dev_fix_daily
runhey Oct 26, 2025
5481d71
Merge pull request #1194 from BluettDream/dev_fix_mail
runhey Oct 26, 2025
ab8d87c
Merge remote-tracking branch 'origin/dev' into dev
runhey Oct 26, 2025
d222a6a
fix(RichMan): buy black scrap
BluettDream Oct 27, 2025
37eb4c5
fix(RichMan): buy sca six star cannot close page
BluettDream Oct 27, 2025
ea508c2
Merge pull request #1202 from BluettDream/dev_fix_richman
runhey Oct 27, 2025
d7f2400
Merge pull request #1193 from BluettDream/dev_fix_ryoutoppa
runhey Oct 27, 2025
8ad36e1
Merge pull request #1192 from BluettDream/dev_fix_expyoukai
runhey Oct 27, 2025
0c352d6
Merge pull request #1191 from BluettDream/dev_fix_bondling
runhey Oct 27, 2025
46e16ba
Merge pull request #1190 from BluettDream/dev_fix_kikkai
runhey Oct 27, 2025
df1dbed
fix(Restart): remove redundant screenshot in harvest_mail
runhey Oct 27, 2025
0d7ccd4
Merge remote-tracking branch 'origin/dev' into dev
runhey Oct 27, 2025
d914a02
fix(WeeklyTrifles): broken amulet error
BluettDream Oct 28, 2025
f42208d
fix(ReplaceShiki): change detect pos ,change no shiki logic and add u…
BluettDream Oct 29, 2025
2120012
fix(ReplaceShiki): decrease roi back size
BluettDream Oct 29, 2025
aa75b30
fix(Hya): No such file hya_check_invitation.png
BluettDream Oct 29, 2025
a7f80e6
Merge pull request #1208 from BluettDream/dev_hya
runhey Oct 29, 2025
baa66df
Merge pull request #1207 from BluettDream/dev_fix_replaceshiki
runhey Oct 29, 2025
9d601ba
Merge pull request #1203 from BluettDream/dev_fix_weekly
runhey Oct 29, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ module/config/i18n/*.json
!dev_tools/ViewWizard2/ViewWizard2.exe
!dev_tools/ViewWizard3/ViewWizard.exe
dev_tools/assets_test.py
hya
#hya
deploy/launcher/oas-backend.bat
deploy/launcher/oas-server.bat
oas-backend.bat
Expand Down
3 changes: 3 additions & 0 deletions deploy/docker/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

requirements_generator.py

37 changes: 37 additions & 0 deletions deploy/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# docker build -t qwerty/oas:latest .
# docker run -v ${PWD}:/app/OnmyojiAutoScript -p 22288:22288 --name oas -it --rm qwerty/oas


FROM python:3.10-slim-bookworm

WORKDIR /app/OnmyojiAutoScript

COPY requirements.txt /tmp/requirements.txt

# python:3.10-slim is based on debian:12, apt source from https://developer.aliyun.com/mirror/debian
RUN echo "\
deb https://mirrors.cloud.tencent.com/debian/ bookworm main non-free non-free-firmware contrib \n\
deb-src https://mirrors.cloud.tencent.com/debian/ bookworm main non-free non-free-firmware contrib \n\
deb https://mirrors.cloud.tencent.com/debian-security/ bookworm-security main \n\
deb-src https://mirrors.cloud.tencent.com/debian-security/ bookworm-security main \n\
deb https://mirrors.cloud.tencent.com/debian/ bookworm-updates main non-free non-free-firmware contrib \n\
deb-src https://mirrors.cloud.tencent.com/debian/ bookworm-updates main non-free non-free-firmware contrib \n\
deb https://mirrors.cloud.tencent.com/debian/ bookworm-backports main non-free non-free-firmware contrib \n\
deb-src https://mirrors.cloud.tencent.com/debian/ bookworm-backports main non-free non-free-firmware contrib \
"\
> /etc/apt/sources.list\
&& apt update \
&& apt install -y git adb libgomp1 openssh-client \
&& git config --global --add safe.directory '*' \
&& ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& echo 'Asia/Shanghai' > /etc/timezone \
&& pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple \
&& pip install -r /tmp/requirements.txt \
&& pip uninstall -y opencv-python\
&& pip uninstall -y opencv-python-headless\
&& pip install opencv-python-headless==4.7.0.72\
&& rm /tmp/requirements.txt \
&& rm -r ~/.cache/pip

CMD python server.py
#CMD /bin/bash
32 changes: 32 additions & 0 deletions deploy/docker/Dockerfile.cn
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# docker build -t qwerty/oas:latest .
# docker run -v ${PWD}:/app/OnmyojiAutoScript -p 22288:22288 --name oas -it --rm qwerty/oas


FROM python:3.10-slim-bullseye

WORKDIR /app/OnmyojiAutoScript

COPY requirements.txt /tmp/requirements.txt

# python:3.10-slim is based on debian:11, apt source from https://developer.aliyun.com/mirror/debian
RUN echo "\
deb https://mirrors.aliyun.com/debian/ bullseye main non-free contrib\n\
deb-src https://mirrors.aliyun.com/debian/ bullseye main non-free contrib\n\
deb https://mirrors.aliyun.com/debian-security/ bullseye-security main\n\
deb-src https://mirrors.aliyun.com/debian-security/ bullseye-security main\n\
deb https://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib\n\
deb-src https://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib\n\
# deb https://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib\n\
# deb-src https://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib" \
> /etc/apt/sources.list \
&& apt update \
&& apt install -y git adb libgomp1 openssh-client \
&& git config --global --add safe.directory '*' \
&& ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& echo 'Asia/Shanghai' > /etc/timezone \
&& pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple \
&& pip install -r /tmp/requirements.txt \
&& rm /tmp/requirements.txt \
&& rm -r ~/.cache/pip

CMD python --version
172 changes: 172 additions & 0 deletions deploy/docker/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
#

# This file is autogenerated by pip-compile with Python 3.10

# by the following command:

# pip-compile --annotation-style=line --output-file=requirements.txt requirements-in.txt
adbutils==0.11.0
# via -r requirements-in.txt, uiautomator2
annotated-types==0.7.0
# via pydantic
anyio==3.7.1
# via fastapi, starlette
anytree==2.8.0
# via -r requirements-in.txt
apkutils2==1.0.0
# via adbutils
cached-property==1.5.2
# via uiautomator2
certifi==2023.11.17
# via requests
cffi==1.16.0
# via cryptography, gevent
charset-normalizer==3.3.2
# via requests
cigam==0.0.3
# via apkutils2
click==8.1.7
# via uvicorn
cn2an==0.5.23
# via -r requirements-in.txt
colorama==0.4.6
# via click, logzero, tqdm
coloredlogs==15.0.1
# via onnxruntime
cryptography==42.0.8
# via -r requirements-in.txt
decorator==5.1.1
# via retry
deprecated==1.2.14
# via uiautomator2
deprecation==2.1.0
# via adbutils
exceptiongroup==1.2.0
# via anyio
fastapi==0.104.1
# via -r requirements-in.txt
filelock==3.13.1
# via uiautomator2
flatbuffers==23.5.26
# via onnxruntime
future==0.18.3
# via zerorpc
gevent==23.9.1
# via zerorpc
greenlet==3.0.3
# via gevent
h11==0.14.0
# via uvicorn
humanfriendly==10.0
# via coloredlogs
idna==3.6
# via anyio, requests
inflection==0.5.1
# via -r requirements-in.txt
logzero==1.7.0
# via uiautomator2
lxml==5.0.0
# via uiautomator2
markdown-it-py==2.2.0
# via rich
mdurl==0.1.2
# via markdown-it-py
mpmath==1.3.0
# via sympy
msgpack==1.0.7
# via zerorpc
numpy==1.24.3
# via -r requirements-in.txt, onnxruntime, opencv-python, ppocr-onnx, shapely
oashya==0.0.7
# via -r requirements-in.txt
onepush==1.3.0
# via -r requirements-in.txt
onnxruntime==1.16.3
# via ppocr-onnx
opencv-python-headless==4.7.0.72
packaging==20.9
# via deprecation, onnxruntime, uiautomator2
paho-mqtt==1.6.1
# via -r requirements-in.txt
pillow==10.2.0
# via ppocr-onnx, uiautomator2
ppocr-onnx==0.0.3.9
# via -r requirements-in.txt
proces==0.1.7
# via cn2an
progress==1.6
# via uiautomator2
protobuf==4.25.1
# via onnxruntime
psutil==6.1.1
# via -r requirements-in.txt
py==1.11.0
# via retry
pyclipper==1.3.0.post5
# via ppocr-onnx
pycparser==2.21
# via cffi
pycryptodome==3.21.0
# via onepush
pydantic==2.10.0
# via -r requirements-in.txt, fastapi
pydantic-core==2.27.0
# via pydantic
pyelftools==0.30
# via apkutils2
pygments==2.17.2
# via rich
pyparsing==3.1.1
# via packaging
pyreadline3==3.4.1
# via humanfriendly
pyyaml==6.0
# via -r requirements-in.txt
pyzmq==25.1.2
# via zerorpc
requests==2.31.0
# via adbutils, onepush, ppocr-onnx, uiautomator2
retry==0.9.2
# via adbutils, uiautomator2
rich==13.3.5
# via -r requirements-in.txt
shapely==2.0.2
# via ppocr-onnx
six==1.16.0
# via adbutils, anytree, uiautomator2
sniffio==1.3.0
# via anyio
starlette==0.27.0
# via fastapi
sympy==1.12
# via onnxruntime
tqdm==4.65.0
# via -r requirements-in.txt
typing-extensions==4.12.2
# via fastapi, pydantic, pydantic-core, uvicorn
uiautomator2==2.16.17
# via -r requirements-in.txt
uiautomator2cache==0.3.0.1
# via -r requirements-in.txt
urllib3==2.1.0
# via requests
uvicorn==0.23.2
# via -r requirements-in.txt
websockets==11.0.3
# via -r requirements-in.txt
whichcraft==0.6.1
# via adbutils, uiautomator2
wrapt==1.15.0
# via -r requirements-in.txt, deprecated
xmltodict==0.13.0
# via apkutils2
zerorpc==0.6.3
# via -r requirements-in.txt
zope-event==5.0
# via gevent
zope-interface==6.1
# via gevent

# The following packages are considered to be unsafe in a requirements file:

# setuptools
62 changes: 62 additions & 0 deletions deploy/docker/requirements_generator.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import os

from deploy.logger import logger

BASE_FOLDER = os.path.dirname(os.path.abspath(__file__))
logger.info(BASE_FOLDER)


def read_file(file):
out = {}
with open(file, 'r', encoding='utf-8') as f:
for line in f.readlines():
if not line.strip():
continue
res = [s.strip() for s in line.split('==')]
if len(res) > 1:
name, version = res
else:
name, version = res[0], None
out[name] = version

return out


def write_file(file, data):
lines = []
for name, version in data.items():
if version:
lines.append(f'{name}=={version}')
else:
lines.append(str(name))

with open(file, 'w', encoding='utf-8', newline='') as f:
text = '\n'.join(lines)
text = text.replace('#', '\n#').strip()
f.write(text)


def docker_requirements_generate(requirements_in='requirements.txt'):
requirements = read_file(requirements_in)

logger.info(f'Generate requirements for Docker image')
lock = {}
new = {}
logger.info(requirements)
for name, version in requirements.items():
# alas-webapp is for windows only
if name == 'alas-webapp' or name == 'pywin32':
continue
if name == 'opencv-python':
name = 'opencv-python-headless'
version = '4.7.0.72'
if name in lock:
version = lock[name] if not isinstance(lock[name], dict) else lock[name]['version']
name = name if not isinstance(lock[name], dict) else lock[name]['name']
new[name] = version

write_file(os.path.join(BASE_FOLDER, f'./requirements.txt'), data=new)


if __name__ == '__main__':
docker_requirements_generate()
13 changes: 13 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

services:
OAS:
network_mode: host
volumes:
- '.:/app/OnmyojiAutoScript:rw'
- '/etc/localtime:/etc/localtime:ro'
container_name: 'oas-env'
image: 'oas-env'
build:
context: ./deploy/docker/
dockerfile: ./Dockerfile
# dockerfile: ./Dockerfile
29 changes: 29 additions & 0 deletions module/config/config_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,35 @@ def script_set_arg(self, task: str, group: str, argument: str, value) -> bool:
logger.error(e)
return False

def copy_script_task(self, task_name: str, source_task: BaseModel) -> bool:
model_task_name = convert_to_underscore(task_name)
try:
setattr(self, model_task_name, source_task)
self.save()
logger.info(f'Copy task {model_task_name} success')
return True
except ValidationError as e:
logger.error(e)
return False

def copy_task_group(self, task_name: str, group_name: str, source_task: BaseModel) -> bool:
model_task_name = convert_to_underscore(task_name)
model_group_name = convert_to_underscore(group_name)
task_object = getattr(self, model_task_name, None)
if not task_object:
return False
source_group_obj = getattr(source_task, model_group_name, None)
if not source_group_obj:
return False
try:
setattr(task_object, model_group_name, source_group_obj)
self.save()
logger.info(f'Copy task group {model_task_name}.{model_group_name} success')
return True
except ValidationError as e:
logger.error(e)
return False

def replace_next_run(self, d, dt: datetime):
for k, v in d.items():
if isinstance(v, dict):
Expand Down
2 changes: 1 addition & 1 deletion module/device/control.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from module.device.method.minitouch import Minitouch
from module.device.method.adb import Adb
from module.device.method.scrcpy import Scrcpy
from module.device.method.window import Window
from module.device.method.windows import Window
from module.logger import logger


Expand Down
1 change: 0 additions & 1 deletion module/device/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
from module.logger import logger



class Device(Platform, Screenshot, Control, AppControl):
_screen_size_checked = False
detect_record = set()
Expand Down
Loading