Skip to content

Commit

Permalink
Merge pull request #4 from wangshub/master
Browse files Browse the repository at this point in the history
update from wangshub
  • Loading branch information
lstk520 authored Dec 31, 2017
2 parents 7b6f2aa + c134bf5 commit 0989467
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 11 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

[github项目地址](https://github.com/wangshub/wechat_jump_game)

QQ群:github微信跳一跳 **314659953**
* QQ群
* github微信跳一跳 **314659953**(已满)
* github微信跳一跳(2) **176740763**

### **更新日志:**

Expand All @@ -25,9 +27,9 @@ QQ群:github微信跳一跳 **314659953**
- 参数出错请在这里提交:[issues/62](https://github.com/wangshub/wechat_jump_game/issues/62)
- 如果你是ios参考一下: [issues/99](https://github.com/wangshub/wechat_jump_game/issues/99)
[/issues/4](https://github.com/wangshub/wechat_jump_game/issues/4)
- 如果你想自动运行:请运行`wechat_jump_auto.py`,记得修改`config.json`参数
- 如果你想自动运行:请运行`wechat_jump_auto.py`,记得修改`/config/default.json`参数(这个是默认的配置)
- 如果你是ios,请运行:`wechat_jump_iOS_py3.py`
- 更新了一些分辨率参数配置,请按照你的手机分辨率从`config/`文件夹找到相应的配置,拷贝到*.py同级目录;
- 更新了一些分辨率参数配置,请按照你的手机分辨率从`config/`文件夹找到相应的配置,拷贝到*.py同级目录;(如果屏幕分辨率能成功探测,会直接调用config目录的配置,不需要复制)
- 注意:别刷太高,已经有同学遇到分数清零的情况了[164](https://github.com/wangshub/wechat_jump_game/issues/164)
- 如果有找不到`./autojump.png`图片的错误,请查阅[194](https://github.com/wangshub/wechat_jump_game/issues/194)

Expand Down
2 changes: 1 addition & 1 deletion config.json → config/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
"press_coefficient": 1.392,
"piece_base_height_1_2": 20,
"piece_body_width": 70
}
}
13 changes: 13 additions & 0 deletions config/mi/mi5_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"under_game_score_y": 300,
"press_coefficient": 1.475,
"piece_base_height_1_2": 20,
"piece_body_width": 70,

"swipe" : {
"x1": 540,
"y1": 1514,
"x2": 540,
"y2": 1514
}
}
14 changes: 10 additions & 4 deletions config/mi/mi5x_config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
{
"under_game_score_y": 300,
"press_coefficient": 1.45,
"piece_base_height_1_2": 25,
"piece_body_width": 80
"under_game_score_y": 300,
"press_coefficient": 1.45,
"piece_base_height_1_2": 25,
"piece_body_width": 80,
"swipe": {
"x1": 560,
"y1": 1550,
"x2": 560,
"y2": 1550
}
}
12 changes: 12 additions & 0 deletions config/mi/note2_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"under_game_score_y": 300,
"press_coefficient": 1.47,
"piece_base_height_1_2": 25,
"piece_body_width": 80,
"swipe" : {
"x1": 540,
"y1": 1600,
"x2": 540,
"y2": 1600
}
}
9 changes: 6 additions & 3 deletions wechat_jump_auto.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,16 @@

def open_accordant_config():
screen_size = _get_screen_size()
config_file = "./config/{screen_size}/config.json".format(
config_file = "{path}/config/{screen_size}/config.json".format(
path=sys.path[0],
screen_size=screen_size
)
if os.path.exists(config_file):
with open(config_file, 'r') as f:
print("Load config file from {}".format(config_file))
return json.load(f)
else:
with open('config.json', 'r') as f:
with open('{}/config/default.json'.format(sys.path[0]), 'r') as f:
print("Load default config")
return json.load(f)

Expand Down Expand Up @@ -76,7 +77,9 @@ def _get_screen_size():

def pull_screenshot():
process = subprocess.Popen('adb shell screencap -p', shell=True, stdout=subprocess.PIPE)
screenshot = process.stdout.read().replace(b'\r\n', b'\n')
screenshot = process.stdout.read()
if sys.platform == 'win32':
screenshot = screenshot.replace(b'\r\n', b'\n')
f = open('autojump.png', 'wb')
f.write(screenshot)
f.close()
Expand Down

0 comments on commit 0989467

Please sign in to comment.