Skip to content

Commit c8d93a5

Browse files
author
常伟佳
authored
Merge pull request wangshub#632 from wangshub/dev
Dev to master
2 parents 49e0de1 + 2cdfeb4 commit c8d93a5

File tree

18 files changed

+165
-110
lines changed

18 files changed

+165
-110
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
2+
<!--
3+
感谢您的 pull request!
4+
5+
在 PR 前请尽量做到:
6+
7+
- PR 应基于最新的 master 分支
8+
- 尽量遵守 PEP8 规范
9+
- 分支名是有意义的名称,如 add-config-file-for-mi5s 而不是 patch-1
10+
- 把分支发到 dev
11+
12+
请描述一下 PR 做的事情,更新算法或配置文件请附上最高分数
13+
-->
14+
15+
本次 PR 主要做的事情:
16+
17+
- x
18+
19+
修改后最高分数:x

WechatJump/Config.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import json
88
import re
99

10+
1011
def open_accordant_config():
1112
'''
1213
调用配置文件
@@ -32,7 +33,7 @@ def _get_screen_size():
3233
'''
3334
size_str = os.popen('adb shell wm size').read()
3435
if not size_str:
35-
print('请安装ADB及驱动并配置环境变量')
36+
print('请安装 ADB 及驱动并配置环境变量')
3637
sys.exit()
3738
m = re.search(r'(\d+)x(\d+)', size_str)
3839
if m:

WechatJump/Debug.py

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,26 @@
99

1010
screenshot_backup_dir = 'screenshot_backups/'
1111

12+
1213
def make_debug_dir(screenshot_backup_dir):
1314
'''
1415
创建备份文件夹
1516
'''
1617
if not os.path.isdir(screenshot_backup_dir):
1718
os.mkdir(screenshot_backup_dir)
1819

20+
1921
def backup_screenshot(ts):
2022
'''
2123
为了方便失败的时候 debug
2224
'''
2325
make_debug_dir(screenshot_backup_dir)
2426
shutil.copy('autojump.png', '{}{}.png'.format(screenshot_backup_dir, ts))
2527

28+
2629
def save_debug_screenshot(ts, im, piece_x, piece_y, board_x, board_y):
2730
'''
28-
对debug图片加上详细的注释
31+
对 debug 图片加上详细的注释
2932
'''
3033
make_debug_dir(screenshot_backup_dir)
3134
draw = ImageDraw.Draw(im)
@@ -39,23 +42,25 @@ def save_debug_screenshot(ts, im, piece_x, piece_y, board_x, board_y):
3942
del draw
4043
im.save('{}{}_d.png'.format(screenshot_backup_dir, ts))
4144

45+
4246
def dump_device_info():
4347
'''
4448
显示设备信息
4549
'''
4650
size_str = os.popen('adb shell wm size').read()
4751
device_str = os.popen('adb shell getprop ro.product.model').read()
4852
density_str = os.popen('adb shell wm density').read()
49-
print("如果你的脚本无法工作,上报issue时请copy如下信息:\n**********\
50-
\nScreen: {size}\
51-
\nDensity: {dpi}\
52-
\nDeviceType: {type}\
53-
\nOS: {os}\
54-
\nPython: {python}\n**********".format(
55-
size=size_str.strip(),
56-
type=device_str.strip(),
57-
dpi=density_str.strip(),
58-
os=sys.platform,
59-
python=sys.version
60-
)
61-
)
53+
print("""如果你的脚本无法工作,上报 issue 时请 copy 如下信息:
54+
**********
55+
Screen: {size}
56+
Density: {dpi}
57+
DeviceType: {type}
58+
OS: {os}
59+
Python: {python}
60+
**********""".format(
61+
size=size_str.strip(),
62+
type=device_str.strip(),
63+
dpi=density_str.strip(),
64+
os=sys.platform,
65+
python=sys.version
66+
))

config/1280x720/config.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
"press_coefficient": 2.099,
44
"piece_base_height_1_2": 13,
55
"piece_body_width": 47,
6-
"swipe" : {
7-
"x1": 374,
8-
"y1": 1060,
9-
"x2": 374,
10-
"y2": 1060
6+
"swipe": {
7+
"x1": 374,
8+
"y1": 1060,
9+
"x2": 374,
10+
"y2": 1060
1111
}
1212
}

config/1440x720/config.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"under_game_score_y": 200,
3+
"press_coefficient": 2.099,
4+
"piece_base_height_1_2": 13,
5+
"piece_body_width": 47,
6+
"swipe" : {
7+
"x1": 360,
8+
"y1": 1140,
9+
"x2": 360,
10+
"y2": 1142
11+
}
12+
}

config/1920x1080/config.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
"press_coefficient": 1.392,
44
"piece_base_height_1_2": 20,
55
"piece_body_width": 70,
6-
"swipe" : {
7-
"x1": 500,
8-
"y1": 1600,
9-
"x2": 500,
10-
"y2": 1602
6+
"swipe": {
7+
"x1": 500,
8+
"y1": 1600,
9+
"x2": 500,
10+
"y2": 1602
1111
}
1212
}

config/2560x1440/config.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
"press_coefficient": 1.035,
44
"piece_base_height_1_2": 28,
55
"piece_body_width": 110,
6-
"swipe" : {
7-
"x1": 320,
8-
"y1": 410,
9-
"x2": 320,
10-
"y2": 410
6+
"swipe": {
7+
"x1": 320,
8+
"y1": 410,
9+
"x2": 320,
10+
"y2": 410
1111
}
1212
}

config/huawei/honor_note8_config.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
"press_coefficient": 1.04,
44
"piece_base_height_1_2": 90,
55
"piece_body_width": 120,
6-
"swipe" : {
7-
"x1": 730,
8-
"y1": 2100,
9-
"x2": 720,
10-
"y2": 2100
6+
"swipe": {
7+
"x1": 730,
8+
"y1": 2100,
9+
"x2": 720,
10+
"y2": 2100
1111
}
1212
}

config/iPhone/6_config.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
"press_coefficient": 2.0,
44
"piece_base_height_1_2": 13,
55
"piece_body_width": 49,
6-
7-
"swipe" : {
6+
"swipe": {
87
"x1": 375,
98
"y1": 1055,
109
"x2": 375,

config/iPhone/8P_7P_6sP_6P_config.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
"press_coefficient": 1.2,
44
"piece_base_height_1_2": 20,
55
"piece_body_width": 70,
6-
"swipe" : {
7-
"x1": 320,
8-
"y1": 410,
9-
"x2": 320,
10-
"y2": 410
6+
"swipe": {
7+
"x1": 320,
8+
"y1": 410,
9+
"x2": 320,
10+
"y2": 410
1111
}
1212
}

0 commit comments

Comments
 (0)