Skip to content

Commit 8e56427

Browse files
committed
first commit
0 parents  commit 8e56427

23 files changed

+823
-0
lines changed

.github/workflows/build.yml

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
name: Push REPO
2+
3+
on:
4+
push:
5+
# Sequence of patterns matched against refs/tags
6+
tags:
7+
- 'v*'
8+
9+
jobs:
10+
build:
11+
12+
runs-on: windows-latest
13+
14+
env:
15+
PYTHONIOENCODING: 'UTF-8'
16+
17+
strategy:
18+
matrix:
19+
python-version: [ 3.12.6 ]
20+
21+
steps:
22+
- name: Configure git
23+
run: |
24+
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
25+
git config --global core.autocrlf false
26+
git config --global core.eol lf
27+
git config --global user.email "[email protected]"
28+
git config --global user.name "ok-oldking"
29+
echo "action_state=yellow" >> $env:GITHUB_ENV
30+
echo "${{ env.action_state }}"
31+
32+
- uses: actions/checkout@v2
33+
- name: Set up Python ${{ matrix.python-version }}
34+
uses: actions/setup-python@v2
35+
with:
36+
python-version: ${{ matrix.python-version }}
37+
- name: Set UTF-8 encoding
38+
run: |
39+
set PYTHONIOENCODING=utf-8
40+
set PYTHONLEGACYWINDOWSSTDIO=utf-8
41+
echo PYTHONIOENCODING=utf-8 >> $GITHUB_ENV
42+
43+
- name: Get Changes between Tags
44+
id: changes
45+
uses: simbo/changes-between-tags-action@v1
46+
with:
47+
validate-tag: false
48+
49+
- name: Get tag name
50+
id: tagName
51+
uses: olegtarasov/[email protected]
52+
53+
- name: Install dependencies
54+
run: |
55+
pip install -r requirements.txt
56+
pip install -r requirements-dev.txt
57+
58+
- name: Copy ok-script lib
59+
run: |
60+
python -m ok.update.copy_ok_folder
61+
62+
- name: Rename .py files to .pyx
63+
run: |
64+
Get-ChildItem -Path .\src -Recurse -Filter *.py -Exclude '__init__.py' | ForEach-Object { Rename-Item $_.FullName -NewName ($_.FullName -replace '\.py$', '.pyx') }
65+
66+
- name: build cython
67+
run: |
68+
python setup.py build_ext --inplace
69+
Get-ChildItem -Path .\src -Recurse -Filter *.pyx | ForEach-Object { Remove-Item $_.FullName }
70+
Get-ChildItem -Path .\src -Recurse -Filter *.cpp | ForEach-Object { Remove-Item $_.FullName }
71+
72+
- name: Run tests
73+
run: |
74+
Get-ChildItem -Path ".\tests\*.py" | ForEach-Object {
75+
Write-Host "Running tests in $($_.FullName)"
76+
python -m unittest $_.FullName
77+
}
78+
79+
- name: Build Executable
80+
run: |
81+
echo "tag: ${{ steps.changes.outputs.tag }}"
82+
echo "changes: ${{ steps.changes.outputs.changes }}"
83+
84+
python -m ok.update.package_launcher ${{ steps.tagName.outputs.tag }} deploy.txt
85+
Copy-Item -Path "dist" -Destination "ok-ls" -Recurse
86+
7z a -t7z -r "ok-ls-full-${{ steps.tagName.outputs.tag }}.7z" "ok-ls"
87+
Remove-Item -Path "ok-ls" -Recurse -Force
88+
89+
shell: pwsh
90+
91+
- name: Release
92+
uses: softprops/action-gh-release@v2
93+
if: startsWith(github.ref, 'refs/tags/')
94+
with:
95+
body: |
96+
ok-ls-CPU-full (AMD or other GPUs)
97+
Updates:
98+
${{ steps.changes.outputs.changes }}
99+
files: |
100+
ok-ls-full-${{ steps.tagName.outputs.tag }}.7z
101+
102+
- name: push to coding
103+
run: |
104+
python -m ok.update.push_repos --repos https://${{ secrets.CODING_USERNAME }}:${{ secrets.CODING_PASSWORD }}@e.coding.net/g-frfh1513/ok-wuthering-waves/ok-ls.git --files deploy.txt --tag ${{ steps.tagName.outputs.tag }}

.gitignore

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
my_key.txt
2+
updates/
3+
working/
4+
update/
5+
tesseract
6+
models
7+
fonts
8+
data2
9+
# Byte-compiled / optimized / DLL files
10+
.idea/
11+
data_export
12+
data_import
13+
__pycache__/
14+
*.msgpack
15+
data/
16+
*$py.class
17+
configs/
18+
paddle_model/
19+
ok/
20+
*.dat
21+
ok
22+
md5.txt
23+
update.bat
24+
click_screenshots/
25+
test_scripts/
26+
screenshots/
27+
thread_dumps.txt
28+
# C extensions
29+
*.so
30+
*.bat
31+
32+
# Distribution / packaging
33+
.Python
34+
test/
35+
logs/
36+
build/
37+
develop-eggs/
38+
dist/
39+
downloads/
40+
eggs/
41+
.eggs/
42+
lib/
43+
lib64/
44+
parts/
45+
sdist/
46+
var/
47+
wheels/
48+
share/python-wheels/
49+
*.egg-info/
50+
.installed.cfg
51+
*.egg
52+
MANIFEST
53+
venv/
54+
.venv/
55+
python/
56+
57+
# PyInstaller
58+
# Usually these files are written by a python script from a template
59+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
60+
*.manifest
61+
62+
# Installer logs
63+
pip-log.txt
64+
pip-delete-this-directory.txt
65+
autohelper
66+
working_images/

README.md

Whitespace-only changes.

config.py

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
import os
2+
3+
version = "v5.0.11"
4+
5+
config = {
6+
'debug': False, # Optional, default: False
7+
'use_gui': True,
8+
'config_folder': 'configs',
9+
'gui_icon': 'icon.png',
10+
# 'auth': {
11+
# 'app_id': 'ok-ls',
12+
# 'trial': True
13+
# },
14+
'ocr': {
15+
'lib': 'rapidocr_openvino',
16+
'target_height': 540
17+
},
18+
'windows': { # required when supporting windows game
19+
'exe': 'GF2_Exilium.exe',
20+
# 'calculate_pc_exe_path': calculate_pc_exe_path,
21+
# 'hwnd_class': 'UnrealWindow',
22+
# 'interaction': 'PostMessage',
23+
'can_bit_blt': True, # default false, opengl games does not support bit_blt
24+
'bit_blt_render_full': True,
25+
'check_hdr': False,
26+
'force_no_hdr': False,
27+
'check_night_light': True,
28+
'force_no_night_light': False,
29+
'require_bg': True
30+
},
31+
'start_timeout': 120, # default 60
32+
'wait_until_before_delay': 2, # default 1 , for wait_until() function
33+
# 'template_matching': {
34+
# 'coco_feature_json': os.path.join('assets', 'result.json'),
35+
# 'default_horizontal_variance': 0.003,
36+
# 'default_vertical_variance': 0.003,
37+
# 'default_threshold': 0.78,
38+
# },
39+
'adb': {
40+
'packages': ['com.haoplay.game.and.exilium']
41+
},
42+
'window_size': {
43+
'width': 1200,
44+
'height': 800,
45+
'min_width': 600,
46+
'min_height': 450,
47+
},
48+
'supported_resolution': {
49+
'ratio': '16:9',
50+
'min_size': (1280, 720),
51+
'resize_to': [(2560, 1440), (1920, 1080), (1280, 720)]
52+
},
53+
'git_update': {'sources': [
54+
{
55+
'name': '阿里云',
56+
'git_url': 'https://e.coding.net/g-frfh1513/ok-wuthering-waves/ok-ls.git',
57+
'pip_url': 'https://mirrors.aliyun.com/pypi/simple'
58+
},
59+
{
60+
'name': '清华大学',
61+
'git_url': 'https://e.coding.net/g-frfh1513/ok-wuthering-waves/ok-ls.git',
62+
'pip_url': 'https://pypi.tuna.tsinghua.edu.cn/simple'
63+
},
64+
{
65+
'name': '腾讯云',
66+
'git_url': 'https://e.coding.net/g-frfh1513/ok-wuthering-waves/ok-ls.git',
67+
'pip_url': 'https://mirrors.cloud.tencent.com/pypi/simple'
68+
},
69+
]},
70+
'screenshots_folder': "screenshots",
71+
'gui_title': 'ok-gf2', # Optional
72+
# 'coco_feature_folder': get_path(__file__, 'assets/coco_feature'), # required if using feature detection
73+
'log_file': 'logs/ok-ww.log', # Optional, auto rotating every day
74+
'error_log_file': 'logs/ok-ww_error.log',
75+
'version': version,
76+
'onetime_tasks': [ # tasks to execute
77+
["src.tasks.DailyTask", "DailyTask"],
78+
79+
],
80+
'my_app': ['src.globals', 'Globals'],
81+
}

deploy.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
src
2+
ok
3+
config.py
4+
main.py
5+
ok-ls.exe
6+
main.py
7+
assets
8+
icon.png
9+
requirements.txt
10+
README.md
11+
.gitignore

icon.png

202 KB
Loading

local_build.ps1

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
pip install -r requirements.txt
2+
pip install -r requirements-dev.txt
3+
4+
python -m ok.update.copy_ok_folder
5+
6+
Get-ChildItem -Path .\src -Recurse -Filter *.py -Exclude '__init__.py' | ForEach-Object { Rename-Item $_.FullName -NewName ($_.FullName -replace '\.py$', '.pyx') }
7+
8+
$currentTag = git describe --tags $(git rev-list --tags="v*" --max-count=1 --current)
9+
10+
python setup.py build_ext --inplace
11+
Get-ChildItem -Path .\src -Recurse -Filter *.pyx | ForEach-Object { Remove-Item $_.FullName }
12+
Get-ChildItem -Path .\src -Recurse -Filter *.cpp | ForEach-Object { Remove-Item $_.FullName }
13+
14+
15+
python -m ok.test.RunTests
16+
17+
18+
19+
python -m ok.update.package_launcher $currentTag deploy.txt
20+
python -m ok.update.package_full_with_profile $currentTag 0
21+
Copy-Item -Path "dist" -Destination "ok-nslg" -Recurse
22+
7z a -t7z -r "ok-nslg-$currentTag.7z" "ok-nslg"
23+
Remove-Item -Path "ok-nslg" -Recurse -Force
24+
25+
26+
python -m ok.update.push_repos --repos https://pt6zehyzhff2:a53da683819bfc7720e03bc93928eed88c5028ba@e.coding.net/g-frfh1513/ok-wuthering-waves/ok-nslg.git --files deploy.txt

main.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import ok
2+
from config import config
3+
4+
if __name__ == '__main__':
5+
config = config
6+
ok = ok.OK(config)
7+
ok.start()

main_debug.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import ok
2+
from config import config
3+
4+
if __name__ == '__main__':
5+
config = config
6+
config['debug'] = True
7+
ok = ok.OK(config)
8+
ok.start()

ok-ls.exe

353 KB
Binary file not shown.

0 commit comments

Comments
 (0)