wechat_jump_game icon indicating copy to clipboard operation
wechat_jump_game copied to clipboard

好用的参数以及晒分发到这里

Open binderclip opened this issue 7 years ago • 97 comments

欢迎可用的同学把自己的参数贴在这里,这里不接受问题 参数没设置好的发这里 · Issue #62 模板如下

机型: 分辨率(写明宽高): 具体参数:

under_game_score_y = 
press_coefficient = 
piece_base_height_1_2 = 
piece_body_width = 

最高打到了多少分(欢迎截图):

binderclip avatar Dec 30 '17 05:12 binderclip

我的是小米手机5s Plus,5.7英寸屏幕,1920*1080分辨率,press_coefficient=1.418比较合适

VitalyAnkh avatar Dec 30 '17 06:12 VitalyAnkh

锤子M1L,分辨率 2660x1440 under_game_score_y = 390 press_coefficient = 1.04 piece_base_height_1_2 = 26 piece_body_width = 110

目前最高分是878

hiyoi avatar Dec 30 '17 06:12 hiyoi

机型:一加3T 分辨率(写明宽高):1920x1080 具体参数:默认参数 最高打到了多少分(欢迎截图): image image

binderclip avatar Dec 30 '17 06:12 binderclip

1加3T不是1920*1080的吗?

juemeng avatar Dec 30 '17 06:12 juemeng

@juemeng 手抖

binderclip avatar Dec 30 '17 06:12 binderclip

小米6,分辨率 1920x1080 press_coefficient = 1.418 其他参数未修改

ps:自动开始游戏参数修改:swipe_x1,swipe_y1,swipe_x2,swipe_y2 = 560, 1550,560,1550

目前最高分是697

wangjian-k avatar Dec 30 '17 06:12 wangjian-k

一加3T 1920*1080 ubuntu 默认参数 三千分

c588 avatar Dec 30 '17 06:12 c588

一加5T 1080*2160 win7

第一步都跑不起来

zhuangsen avatar Dec 30 '17 07:12 zhuangsen

我也是一加3T,8.0公测第五版Room。。默认参数10位数就死了。。

juemeng avatar Dec 30 '17 07:12 juemeng

机型:一加5 分辨率(写明宽高):1920x1080 系数:1.392 216

gunten avatar Dec 30 '17 07:12 gunten

努比亚z17s,分辨率 2040x1080 under_game_score_y = 360 // 只改了这个参数 press_coefficient = 1.392 piece_base_height_1_2 = 25 piece_body_width = 80

最高分正在生成中(准备跑个2333😶),目前很高几率可以落在正中心

F-loat avatar Dec 30 '17 07:12 F-loat

大佬,请问这个参数在代码哪个地方更改?

cc-cfg avatar Dec 30 '17 07:12 cc-cfg

@a772856947 xxxxx_auto.py文件中

mg459046365 avatar Dec 30 '17 07:12 mg459046365

@mg459046365 具体是贴哪个方法下面

cc-cfg avatar Dec 30 '17 07:12 cc-cfg

@a772856947 不用贴。# Magic Number,不设置可能无法正常执行,请根据具体截图从上到下按需设置。这句话,下面的几个数字都是可以调的。你根据说明去调节就行了。

mg459046365 avatar Dec 30 '17 07:12 mg459046365

谢谢大佬 @mg459046365

cc-cfg avatar Dec 30 '17 07:12 cc-cfg

一加5t,目前可以正常跳跃了 具体参数如下: under_game_score_y = 500 press_coefficient = 1.392 piece_base_height_1_2 = 25 piece_body_width = 80

ww10075 avatar Dec 30 '17 07:12 ww10075

机型:小米Mix 2 参数

under_game_score_y = 420    
press_coefficient = 1.673   
swipe_x1, swipe_y1, swipe_x2, swipe_y2 = 600, 1800, 600, 1800     
piece_body_width = 85      

代码段

# coding: utf-8
import os
import time
import math
from PIL import Image
import random

# Magic Number,不设置可能无法正常执行,请根据具体截图从上到下按需设置
under_game_score_y = 420     # 截图中刚好低于分数显示区域的 Y 坐标,300 是 1920x1080 的值,2K 屏、全面屏请根据实际情况修改
press_coefficient = 1.673      # 长按的时间系数,请自己根据实际情况调节
swipe_x1, swipe_y1, swipe_x2, swipe_y2 = 600, 1800, 600, 1800     # 模拟按压的起始点坐标,需要自动重复游戏请设置成“再来一局”的坐标
piece_body_width = 85       # 棋子的宽度,比截图中量到的稍微大一点比较安全,可能要调节


def pull_screenshot():
    os.system('adb shell screencap -p /sdcard/1.png')
    os.system('adb pull /sdcard/1.png .')


def backup_screenshot(ts):
    # 为了方便失败的时候 debug
    dir_path = 'screenshot_backups/'
    if not os.path.isdir(dir_path):
        os.mkdir(dir_path)
    os.system('cp 1.png {}{}.png'.format(dir_path, ts))


def jump(distance):
    press_time = distance * press_coefficient
    press_time = max(press_time, 200)   # 设置 200 ms 是最小的按压时间
    press_time = int(press_time)
    cmd = 'adb shell input swipe {} {} {} {} {}'.format(swipe_x1, swipe_y1, swipe_x2, swipe_y2, press_time)
    print(cmd)
    os.system(cmd)


def find_piece_and_board(im):
    w, h = im.size

    for i in range(int(0.5*h), int(0.6*h)):
        piece_x_sum = 0
        piece_x_c = 0

        for j in range(w):
            pixel = im.getpixel((j, i))
            # 根据棋子的最低行的颜色判断,找最后一行那些点的平均值,这个颜色这样应该 OK,暂时不提出来
            if (50 < pixel[0] < 60) and (53 < pixel[1] < 63) and (95 < pixel[2] < 110):
                piece_x_sum += j
                piece_x_c += 1
        if piece_x_c:
            piece_x = piece_x_sum / piece_x_c
            break

    if not piece_x_c:
        return 0, 0
    
    for i in range(under_game_score_y, h):
        last_pixel = im.getpixel((0, i))
        board_x_sum = 0
        board_x_c = 0

        for j in range(w):
            pixel = im.getpixel((j, i))
            # 修掉脑袋比下一个小格子还高的情况的 bug
            if abs(j - piece_x) < piece_body_width:
                continue

            # 修掉圆顶的时候一条线导致的小 bug,这个颜色判断应该 OK,暂时不提出来
            if abs(pixel[0] - last_pixel[0]) + abs(pixel[1] - last_pixel[1]) + abs(pixel[2] - last_pixel[2]) > 5:
                board_x_sum += j
                board_x_c += 1
        if board_x_sum:
            board_x = board_x_sum / board_x_c
            break

    if not board_x:
        return 0, 0

    return piece_x, board_x


def main():
    while True:
        pull_screenshot()
        im = Image.open("./1.png")
        # 获取棋子和 board 的位置
        piece_x, board_x = find_piece_and_board(im)
        ts = int(time.time())
        print(piece_x, board_x)
        jump(abs(board_x - piece_x))
        backup_screenshot(ts)
        time.sleep(random.uniform(1.2, 1.5))   # 为了保证截图的时候应落稳了,多延迟一会儿

if __name__ == '__main__':
    main()

只用X坐标来调整,最高分是 536

Jing-Luo avatar Dec 30 '17 07:12 Jing-Luo

红米5 Plus 目前最高分跳到 500 多 就自杀了

under_game_score_y = 440 press_coefficient = 1.5 piece_base_height_1_2 = 25 piece_body_width = 80

timmy-gzw avatar Dec 30 '17 07:12 timmy-gzw

荣耀note 8,分辨率 2560x1440

参数:

under_game_score_y = 385
press_coefficient = 1.04 piece_base_height_1_2 = 25
piece_body_width = 110

大概率落在中心点,分数1008了,还不挂,不玩了。。。

sam453 avatar Dec 30 '17 08:12 sam453

under_game_score_y = 390 # 截图中刚好低于分数显示区域的 Y 坐标,300 是 1920x1080 的值,2K 屏、全面屏请根据实际情况修改 press_coefficient = 1.04 # 长按的时间系数,请自己根据实际情况调节 swipe_x1, swipe_y1, swipe_x2, swipe_y2 = 750, 2118,750, 2118 # 模拟按压的起始点坐标,需要自动重复游戏请设置成“再来一局”的坐标 piece_base_height_1_2 = 26 # 二分之一的棋子底座高度,可能要调节 piece_body_width = 102 # 棋子的宽度,比截图中量到的稍微大一点比较安全,可能要调节

华为mate9 pro 分辨率 1440*2550 第一次跑就是很高分,,这个脚本太厉害了,,我用的auto那个

docwei2050 avatar Dec 30 '17 09:12 docwei2050

@ww10075 为啥我的不可以呢

zhuangsen avatar Dec 30 '17 09:12 zhuangsen

华为mate9 默认设置 1636

xiaooooooowu avatar Dec 30 '17 10:12 xiaooooooowu

三星NOTE5 分辨率调到1920×1080 默认参数,正在蹦,比较完美 300分的时候蹦出去了

Francis-G avatar Dec 30 '17 10:12 Francis-G

有没有红米note4x的参数啊

SergioJune avatar Dec 30 '17 11:12 SergioJune

720*1080 参数如下: under_game_score_y = 250
press_coefficient = 2.1

lijinhua avatar Dec 30 '17 11:12 lijinhua

MIX2 MIUI9 Android 8.0 2160x1080 under_game_score_y = 420
press_coefficient = 1.373
swipe_x1, swipe_y1, swipe_x2, swipe_y2 = 600, 1800, 600, 1800
piece_base_height_1_2 = 25
piece_body_width = 85
sample_board_x1, sample_board_y1, sample_board_x2, sample_board_y2 = 353, 859, 772, 1100

aimreant avatar Dec 30 '17 12:12 aimreant

机型:华为荣耀4C 分辨率(写明宽高):720*1280 具体参数: press_coefficient =2.1 其他不变 最高打到了多少分:1282

stardust-sudo avatar Dec 30 '17 13:12 stardust-sudo

小米Note2,MIUI9.1,分辨率1920 x 1080 press_coefficient = 1.498 piece_base_height_1_2 = 22 piece_body_width = 82 其他参数没变

打到500分没问题

liuqinglqlq avatar Dec 30 '17 14:12 liuqinglqlq

坚果 Pro 的参数有没有老铁试出来的

Kenmmm avatar Dec 30 '17 14:12 Kenmmm