STOP_jump的可以改参数吗?小米5总是跳不准,也跳不直
改参数请使用nightly或者master源码
有config文件夹
config.json:
{
"under_game_score_y": 300,
"press_coefficient": 1.392,
"piece_base_height_1_2": 20,
"piece_body_width": 70
}
需修改代码:
def main():
'''
主函数
'''
op = yes_or_no('请确保手机打开了 ADB 并连接了电脑,然后打开跳一跳并【开始游戏】后再用本程序,确定开始?')
if not op:
print('bye')
return
print('程序版本号:{}'.format(VERSION))
debug.dump_device_info()
check_screenshot()
i, next_rest, next_rest_time = 0, random.randrange(3, 10), random.randrange(5, 10)
while True:
pull_screenshot()
im = Image.open('./autojump.png')
# 获取棋子和 board 的位置
piece_x, piece_y, board_x, board_y = find_piece_and_board(im)
ts = int(time.time())
print(ts, piece_x, piece_y, board_x, board_y)
set_button_position(im)
distance = math.sqrt((board_x - piece_x) * 2 + (board_y - piece_y) * 2)
print("start-------- distance --------start: ", distance)
tmp = 0
if distance < 200:
tmp = 38
print("200-------- distance --------200:",tmp)
elif distance < 380:
tmp = 30
print("350-------- distance --------350:",tmp)
elif distance < 480 :
tmp = 25
print("465-------- distance --------465:",tmp)
elif distance < 515 :
tmp = 14
print("500-------- distance --------500:",tmp)
elif distance < 580 :
tmp = 12
print("540-------- distance --------540:",tmp)
elif distance < 635 :
tmp = 5
print("630-------- distance --------630:",tmp)
distance = distance + tmp
print("end-------- distance --------end: ", distance)
jump(distance)
上面所说在哪里修改啊
wechat_jump_auto.py
Most helpful comment
config.json:
{
"under_game_score_y": 300,
"press_coefficient": 1.392,
"piece_base_height_1_2": 20,
"piece_body_width": 70
}
需修改代码:
def main():
'''
主函数
'''
op = yes_or_no('请确保手机打开了 ADB 并连接了电脑,然后打开跳一跳并【开始游戏】后再用本程序,确定开始?')
if not op:
print('bye')
return
print('程序版本号:{}'.format(VERSION))
debug.dump_device_info()
check_screenshot()
i, next_rest, next_rest_time = 0, random.randrange(3, 10), random.randrange(5, 10)
while True:
pull_screenshot()
im = Image.open('./autojump.png')
# 获取棋子和 board 的位置
piece_x, piece_y, board_x, board_y = find_piece_and_board(im)
ts = int(time.time())
print(ts, piece_x, piece_y, board_x, board_y)
set_button_position(im)
distance = math.sqrt((board_x - piece_x) * 2 + (board_y - piece_y) * 2)
print("start-------- distance --------start: ", distance)
tmp = 0
if distance < 200:
tmp = 38
print("200-------- distance --------200:",tmp)
elif distance < 380:
tmp = 30
print("350-------- distance --------350:",tmp)
elif distance < 480 :
tmp = 25
print("465-------- distance --------465:",tmp)
elif distance < 515 :
tmp = 14
print("500-------- distance --------500:",tmp)
elif distance < 580 :
tmp = 12
print("540-------- distance --------540:",tmp)
elif distance < 635 :
tmp = 5
print("630-------- distance --------630:",tmp)
distance = distance + tmp
print("end-------- distance --------end: ", distance)
jump(distance)