wangshub / wechat_jump_game

微信《跳一跳》Python 辅助

Home Page:https://zhuanlan.zhihu.com/p/32452473

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

参数不行的发这里

binderclip opened this issue · comments

commented

现在只能做到一直跳下去(参数设置的合理的情况下),每次正中心是最终的目标。
常用调试思路:

  • 直线的时候每次都跳的近那么调大 press_coefficient,反之调小

=======

  1. 更新最新的代码
  2. 按下面的方式填写

模板如下

机型:
分辨率(具体到宽高):
电脑系统:
问题描述:
(另外请尽量附一张 screenshot_backups 目录下的 _d.png 结尾画了线的图)

commented

机型:一加3T
分辨率:1920x1080
中间有三个偏移了 不过第四个就又跳准了

已经顺利三千分

commented

@CJY825 我的就是用一加 3T 调试写的,应该啥都不用改

commented

@binderclip 那可能就是单纯的人品不好吧 T T

机型:三星S6edge
分辨率:2560x1440

Markdown

机型:小米MIX2
分辨率:1080x2160
电脑系统:WIN10
问题描述:方向都不正确
1514616028_d
1514616045_d
1514616054_d

机型:华为5S
分辨率:720*1280
参数 2.0

机型:荣耀V9
分辨率:2560x1440
根据这个参数到66分挂掉了:
under_game_score_y = 390
press_coefficient = 1.04
piece_base_height_1_2 = 26
piece_body_width = 110

1514612786

红米note4 总是个位数
1514613375_d

commented

机型:小米4c
分辨率:1920 x 1080
press_coefficient = 1.47 其他不变
平均下来 都是各位数, 最高也只跳到了30多
1514611790_d

有一张图吧,因为每次产生的图替换了上一张图。

@binderclip 好像是下次跳的时候,图片经常更新不过来,还是用的上次的图片去跳。 基本两三次就GG

commented

@kunphp 在screamshot_backups里有每一次的截图

@BestTao 小米note2,也是1920x1080,昨天晚上参数1.47,跳到918分。今天更新代码后发现这个参数不行了,需要从新调。

@BestTao 1.47这个参数是我基于昨天晚上的代码调节出来的参数,不过今天到目前为止还没调出比较合理的参数

commented

@liurentian adb 命令有问题?

@binderclip adb没有问题,刚才我可能理解错了

@CJY825 嗯,cp 换成copy就可以了

commented

@BestTao 直线的时候每次都跳的近那么调大 press_coefficient,反之调小

机型:小米5s
分辨率:1920 x 1080
没修改参数的话只能俩位数
修改参数:
piece_base_height_1_2 = 25
piece_body_width = 80
现在跳一千多,给机油们参考下

红米note4 本来1.393几下就完,调了 1.404 参数,现在300还在持续跳

@lw1992 我一会试一下你的参数,我现在最多也就900多

commented

@binderclip 再怎么调高这个参数 还是会掉下去 很多时候并不能跳到黑线的位置
看下面俩图
1514615641_d
1514615650_d

commented

@BestTao 再往大一点调还不行?

小米 MIX 能用的参数
under_game_score_y = 619 # 截图中刚好低于分数显示区域的 Y 坐标,300 是 1920x1080 的值,2K 屏、全面屏请根据实际情况修改
press_coefficient = 1.492 # 长按的时间系数,请自己根据实际情况调节
swipe_x1, swipe_y1, swipe_x2, swipe_y2 = 320, 410, 320, 410 # 模拟按压的起始点坐标,需要自动重复游戏请设置成“再来一局”的坐标
piece_base_height_1_2 = 20 # 二分之一的棋子底座高度,可能要调节
piece_body_width = 70 # 棋子的宽度,比截图中量到的稍微大一点比较安全,可能要调节
sample_board_x1, sample_board_y1, sample_board_x2, sample_board_y2 = 824, 371, 959, 448

仅供参考

一加5T
1080*2160
win7

第一步都跑不起来

image

18.5:9的屏幕,分辨率1440*2960

press_coefficient = 0.68
这么长的线也能跳过去,真是神奇,横向的时候就不好使了,在第一个横向的原地跳了一下,然后就掉下去了,待我降到1080p再试试!

1514622245_d

到这一步就死了。

荣耀8
1080 1920

@lw1992 你的25和80不就是自带的吗,老铁

@lw1992 我的也是小米5s,默认参数就是25 80,默认参数最多也就两位数,修改时间系数press_coefficient=1.45后最多跳了238

魅蓝note6基本是10分左右,参数未改
1920*1080

经常性出现方向判断错误这种情况。

_试了N多次,方向错误一般发生在白块,或者方块向左跳

cap

三星 S7 Edge 测试了下 2K
参数:
under_game_score_y = 385
press_coefficient = 0.68
piece_base_height_1_2 = 25
piece_body_width = 110

右跳时,两者距离长,计算无问题,两者距离短,就会跳过,
左跳时,两者距离短,计算无问题,两者距离长,计算的距离很短,就会跳不到
2464 KB/s (95303 bytes in 0.037s)
(1514635057, 1167, 1523, 1436, 1369)
309.962901006
adb shell input swipe 320 410 320 410 204
309是打印出来的distance

1

红米Note4X,一步都跳不起来。

程序运行不了

ImportError: No module named PIL
这个报错

能正常截图上传png图片

依赖安装那一步怎么做。
pip install -r requirements.txt
这一步不清楚,可以具体说说吗

机型:华为P9
色差识别问题
几千分之后有时背景色和棋盘色差太小
导致错误
其他一切正常

小米max2 1080 *1920 under_game_score_y = 360
press_coefficient = 1.50
piece_base_height_1_2 = 25 # 二分之一的棋子底座高度,可能要调节
piece_body_width = 80 # 棋子的宽度,比截图中量到的稍微大一点比较安全,可能要调节

只能跳到200左右

commented

三星S8
向前面跳没问题,每次向左边跳不过去

commented

机型:Samsung Galaxy S8 Plus
分辨率(具体到宽高):2960 x 1440
电脑系统:MacOS 10.13.3
问题描述:可能连一步都跳不起来。。
1514639175_d
1514639169_d

机型:小米NOTE3
分辨率(具体到宽高):1920x1080像素
电脑系统:WIN10
问题描述:
最多跳到20分
1514639494_d

mix2 0分0.0

Traceback (most recent call last):
File "C:/Users/ls/Desktop/wechat_jump_auto.py", line 161, in
main()
File "C:/Users/ls/Desktop/wechat_jump_auto.py", line 148, in main
im = Image.open("./1.png")
File "C:\Users\ls\AppData\Roaming\Python\Python36\site-packages\PIL\Image.py", line 2530, in open
fp = builtins.open(filename, "rb")
FileNotFoundError: [Errno 2] No such file or directory: './1.png'

请问这是什么错误啊,我要自己创建文件夹吗

@SunMingjun 我也是三星S7edge 按照你调教的参数设置 10分以内,请问一下你的屏幕分辨率设置的是多少呢。

@liaobei 一样的问题 我调了好一会了 现在怎么样了

有悬浮球之类功能的切记要关掉,不关掉跳的不准

Traceback (most recent call last):
File "C:\Users\U\Desktop\wechat_jump_game-master\wechat_jump_auto.py", line 169, in
main()
File "C:\Users\U\Desktop\wechat_jump_game-master\wechat_jump_auto.py", line 156, in main
im = Image.open("./1.png")
File "C:\Python27\lib\site-packages\PIL\Image.py", line 2530, in open
fp = builtins.open(filename, "rb")
IOError: [Errno 2] No such file or directory: './1.png'
我也是,这咋整?

IOError: [Errno 2] No such file or directory: './1.png'的确认下adb是否正常
命令行输入adb devices能否找到设备,如果提示dll文件问题的把adb全都拷到python工程目录下再试试

把两个dll和adb拷到wechat_jump_game-master文件夹下就可以了,搞了半天没搞懂。。。

commented

机型:小米6
分辨率(具体到宽高):1920×1080
电脑系统:Mac
问题描述:跳了两个超准的之后方向不对了

direction_error

小米MIX2的 请将 "under_game_score_y" 从300 改为 540, 可以跑分了, 原理是默认 1080 * 1920 的值 default 300, 小米MIX2的屏幕是 1080 * 2160 , 所以 under_game_score_y = 300 + (2160 - 1920) = 540 , 其他宽 为 1080 高不一样的手机也可以根据这样修改 @qisq777 @WersonLu

调试参数
{
"under_game_score_y": 540,
"press_coefficient": 1.400, (感觉还需要往上调点)
"piece_base_height_1_2": 20,
"piece_body_width": 70
}

commented

方向不对或者是误差巨大的看一下是不是开了侧边栏

在我的小米6上(1920x1080),mac下运行程序,将press_coefficient设为1.45即可正常运行,分数1000+

机型:锤子M1l
分辨率:2560x1440
根据这个参数没挂过,就是不知道程序不稳定,还是我连接不稳定,刷一会儿脚本就会报错,但是游戏不会中断,重新执行脚本就可以继续了。
under_game_score_y = 390
press_coefficient = 1.04
piece_base_height_1_2 = 26
piece_body_width = 110

@kioyong 小米MIX2屏幕分辨率大了,不是都大在上边 了,怎么能直接加呢?根据我我实际测量
调试参数
{
"under_game_score_y": 409,
"press_coefficient": 1.400, (感觉还需要往上调点)
"piece_base_height_1_2": 35,
"piece_body_width": 80
}
sample_board_x1, sample_board_y1, sample_board_x2, sample_board_y2 = 336.5, 1302, 789, 1041

3000+无压力

piece_base_height_1_2 = 25
piece_body_width = 80
1.414 1920*1080
完美

commented

坚果pro2 2160x1080 采用以下配置,至少可刷到1000+

{
    "under_game_score_y": 300,
    "press_coefficient": 1.393,
    "piece_base_height_1_2": 20,
    "piece_body_width": 70
}

小米5x
1920*1080
win10
最高200多
"press_coefficient": 1.494,
"piece_base_height_1_2": 30,
"piece_body_width": 80。
感觉是死在魔方识别错误。
1514664503_d

三星 S8 Plus 分辨率2960*1440
到现在没试出来一个有用的参数
求一个可以用的参数

press_time = math.pow(distance,0.85) * press_coefficient 改为 press_time = distance* press_coefficient 正常运行 1加3t 配置{
"under_game_score_y": 300,
"press_coefficient": 1.392,
"piece_base_height_1_2": 25,
"piece_body_width": 80
}

我是小白,可以帮我看下这是什么错误吗,谢谢

Load config file from ./config/2560x1440/config.json
Traceback (most recent call last):
File "D:\python\wechat_jump_game-master\wechat_jump_auto.py", line 62, in
is_debug = config['debug']
KeyError: 'debug'

is_debug
=1

机型:小米5s
分辨率(具体到宽高):1920*1080
电脑系统:win7
问题描述:
1514702073_d

机型:小米5s
分辨率(具体到宽高):1920*1080
电脑系统:win7
问题描述: 第一步直接跳飞了,参数改小的话,又没法继续
1514702105_d

MI4的参数怎么设置

机型:小米6
分辨率(具体到宽高):1920*1080
电脑系统:ubuntu 16.4
问题描述: 只能跳几十分
1514719442_d

机型:小米6
分辨率:1920 x 1080
电脑系统:windows 10
修改参数:总感觉参数没啥影响,最小调到0.68,最大调过10,20,甚至999感觉区别都不是很大

还有发现一个问题就是, 离得近的方块经常跳不准(不管参数多大都会跳的近一些),离得远的方块经常就会跳到中心
1514719300_d

机型:小米6
分辨率(具体到宽高):1920*1080
电脑系统:win10
问题描述: 只能跳二三百分,离得近的经常跳偏
1514723791_d
1514723794
1514723794_d

手机S7 EDGE

Screen: Physical size: 1440x2560
Density: Physical density: 640
Override density: 560
DeviceType: SM-G9350

电脑系统:deepin 15.5
问题:一直都是0个,跳不准。

=====
Screen: Physical size: 1440x2960
Override size: 1080x2220
Density: Physical density: 560
Override density: 420
DeviceType: SM-G9550

不好用,都是0个

机型:红米note3
分辨率:1920x1080
电脑系统:win10 1709
问题描述:

Screen: Physical size: 1080x1920
Density: Physical density: 480
DeviceType: Redmi Note 3

List of devices attached
75aa12a6 device

Traceback (most recent call last):
File "wechat_jump_auto.py", line 234, in
main()
File "wechat_jump_auto.py", line 221, in main
im = Image.open('./autojump.png')
File "C:\Users\Shinelon\AppData\Local\Programs\Python\Python35\lib\site-packages\PIL\Image.py", line 2572, in open
% (filename if filename else fp))
OSError: cannot identify image file './autojump.png'

这个怎么玩的,有朋友教一下吗。QQ19502438

机型:一加5T
分辨率(具体到宽高):
Screen: Physical size: 1080x2160
Density: Physical density: 420
问题描述:
一般跳到第三个开始偏移,不超过20分
1514742851_d

追加:
将 "press_coefficient" 改为 1.393 完美

commented

Screen: Physical size: 1440x2560
Density: Physical density: 640
DeviceType: SM-G9250
OS: darwin
Python: 2.7.10 (default, Jul 15 2017, 17:16:57)
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)]


List of devices attached
04157df4aa4fb93a device

Traceback (most recent call last):
File "wechat_jump_auto.py", line 236, in
main()
File "wechat_jump_auto.py", line 223, in main
im = Image.open('./autojump.png')
File "/Library/Python/2.7/site-packages/PIL/Image.py", line 2572, in open
% (filename if filename else fp))
IOError: cannot identify image file './autojump.png'


Screen:
Density:
DeviceType:
OS: win32
Python: 3.5.3 (v3.5.3:1880cb95a742, Jan 16 2017, 16:02:32) [MSC v.1900 64 bit (AMD64)]


List of devices attached

error: device not found
Traceback (most recent call last):
File "auto.py", line 236, in
main()
File "auto.py", line 223, in main
im = Image.open('./autojump.png')
File "C:\Users\acer\AppData\Local\Programs\Python\Python35\lib\site-packages\PIL\Image.py", line 2572, in open
% (filename if filename else fp))
OSError: cannot identify image file './autojump.png'

commented

image

机型:iPhone 7
分辨率(具体到宽高):--
电脑系统:mac
问题描述:

建议将 wechat_jump_auto_iOS.py 中的

 if abs(pixel[0] - last_pixel[0]) + abs(pixel[1] - last_pixel[1]) + abs(pixel[2] - last_pixel[2]) > 10

改为

if abs(pixel[0] - last_pixel[0]) + abs(pixel[1] - last_pixel[1]) + abs(pixel[2] - last_pixel[2]) > 2

对于一些圆形带条纹board效果好,完成了500到1000以上的质变

此外

time.sleep(random.uniform(1, 1.1))   # 为了保证截图的时候应落稳了,多延迟一会儿

改成

time.sleep(random.uniform(1.4, 1.5))   # 为了保证截图的时候应落稳了,多延迟一会儿

这样可以吃到大多数的5/10/15/20。

小米6 win10 1920 1080
更新脚本后直接跳偏了,大约到20左右
1514781714_d
1514781745_d
1514781756_d
1514781775_d
1514781783_d

commented

@cold-snap 关闭悬浮球

commented

修改参数再运行程序参数依然使用上一个配置的参数
_ _20180101145328

Screen: Physical size: 1080x1920
Density: Physical density: 480
DeviceType: MI 6
OS: win32
Python: 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:54:40) [MSC v.1900 64 bit (AMD64)]
每次识别图像很准,都能识别到正中心,但是跳的时候尤其距离近的方块,总是跳的近一些,基本每次都在200-250左右

Screen: Physical size: 1440x2960
Density: Physical density: 560
DeviceType: SM-G9550
OS: win32
Python: 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:54:40) [MSC v.1900 64 bit (AMD64)]
三星S8+求一个能用的参数……跳的太远了……

commented

Screen: Physical size: 1080x1920
Density: Physical density: 460
Override density: 480
DeviceType: MI 5
OS: linux
Python: 3.5.4rc1 (default, Jul 25 2017, 08:53:34)
[GCC 6.4.0 20170704]


List of devices attached
c90a4bc9 device

采用方式1获取截图
Traceback (most recent call last):
File "wechat_jump_auto.py", line 380, in
main()
File "wechat_jump_auto.py", line 369, in main
piece_x, piece_y, board_x, board_y = find_piece_and_board(im)
File "wechat_jump_auto.py", line 203, in find_piece_and_board
im_pixel=im.load()
File "/usr/lib/python3/dist-packages/PIL/ImageFile.py", line 212, in load
s = read(self.decodermaxblock)
File "/usr/lib/python3/dist-packages/PIL/PngImagePlugin.py", line 591, in load_read
cid, pos, length = self.png.read()
File "/usr/lib/python3/dist-packages/PIL/PngImagePlugin.py", line 116, in read
raise SyntaxError("broken PNG file (chunk %s)" % repr(cid))
SyntaxError: broken PNG file (chunk b'AT\x8co')
//真心看不懂啊.....大神帮帮忙

一定要注意关掉悬浮球才可生效

commented

Screen: Physical size: 1080x1920
Density: Physical density: 480
DeviceType: PLK-TL01H
OS: win32
Python: 3.6.3 |Anaconda, Inc.| (default, Oct 15 2017, 03:27:45) [MSC v.1900 64 bit (AMD64)]


List of devices attached
A2JDU16705001835 device

Traceback (most recent call last):
File "wechat_jump_auto.py", line 356, in
main()
File "wechat_jump_auto.py", line 343, in main
im = Image.open('./autojump.png')
File "C:\ProgramData\Anaconda3\lib\site-packages\PIL\Image.py", line 2519, in open
% (filename if filename else fp))
OSError: cannot identify image file './autojump.png'
//What's the problem?

commented

{
"under_game_score_y": 340,
"press_coefficient": 2.27,
"piece_base_height_1_2": 25,
"piece_body_width": 80,
"swipe" : {
"x1": 500,
"y1": 1600,
"x2": 500,
"y2": 1603
}
}

360 N4 360OS3 改了好久的参数。。。终于能比较稳了。。【但是很奇怪。。。明明是1920*1080.。。

HTC M8
1920*1080
win7
vmo2dyf la _ ttyh8zk24q

连续两次都是跳这个点的时候,跳过了一点点掉下去了

Screen: Physical size: 1440x2880
Density: Physical density: 640
DeviceType: HTC 2Q4D200
OS: win32
Python: 2.7 (r27:82525, Jul 4 2010, 07:43:08) [MSC v.1500 64 bit (AMD64)]
1514790998_d
参数:
{
"under_game_score_y": 300,
"press_coefficient": 1.04,
"piece_base_height_1_2": 28,
"piece_body_width": 110,
"swipe" : {
"x1": 320,
"y1": 410,
"x2": 320,
"y2": 410
}
}

commented

红米5
分辨率1440*720这个参数咋设置???

机型:小米 note4x
分辨率(具体到宽高):1920X1080
电脑系统:win10
问题描述:不稳定一会跳100多一会200-400就失败了
这是现在的参数,还算跳的稳点,最多400多,不然只能100多:
{
"under_game_score_y": 300,
"press_coefficient": 1.492,
"piece_base_height_1_2": 20,
"piece_body_width": 70,
"swipe" : {
"x1": 500,
"y1": 1600,
"x2": 500,
"y2": 1602
}
}
问题图片

Screen: Physical size: 1440x2560
Density: Physical density: 640
DeviceType: VKY-AL00
OS: win32
Python: 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:54:40) [MSC v.1900 64 bit (AMD64)
]


采用方式2获取截图
scan_start_y: 903
Traceback (most recent call last):
File "wechat_jump_auto.py", line 288, in
main()
File "wechat_jump_auto.py", line 277, in main
piece_x, piece_y, board_x, board_y = find_piece_and_board(im)
File "wechat_jump_auto.py", line 202, in find_piece_and_board
for j in range(board_x_start, board_x_end):
TypeError: 'float' object cannot be interpreted as an integer

{
"under_game_score_y": 300,
"press_coefficient": 1.45,
"piece_base_height_1_2": 20,
"piece_body_width": 70,
"swipe" : {
"x1": 500,
"y1": 1600,
"x2": 500,
"y2": 1602
}
}
小米6 参数如上 能自动跳,但是200多分就会掉下去 希望哪位大神能给个好一点的参数

机型:小米6
分辨率:1920 x 1080
电脑系统:windows 10
修改参数:"press_coefficient": 1.44,

700多的时候,方向出了点问题
1514864507_d

commented

Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:25:58) [MSC v.1500 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.

= RESTART: C:\Users\XUE\Desktop\wechat_jump_game-master\wechat_jump_auto.py =
Load default config
如果你的脚本无法工作,上报issue时请copy如下信息:


Screen: Physical size: 720x1440
Density: Physical density: 320
DeviceType: Redmi 5
OS: win32
Python: 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:25:58) [MSC v.1500 64 bit (AMD64)]


采用方式2获取截图
('scan_start_y: ', 530)
(1514871850, 252, 804, 525, 646)
adb shell input swipe 360 1188 360 1188 734

C:\Users\today\Desktop\game-master>python wechat_jump_auto.py
Load config file from C:\Users\today\Desktop\game-master/config/1920x1080/config.json
Traceback (most recent call last):
File "wechat_jump_auto.py", line 248, in
main()
File "wechat_jump_auto.py", line 225, in main
op = yes_or_no('请确保手机打开了 ADB 并连接了电脑,然后打开跳一跳游戏再用本程序,确定开始?')
File "wechat_jump_auto.py", line 209, in yes_or_no
i = raw_input(prompt)
NameError: name 'raw_input' is not defined

华为荣耀9 1920x1080的
参数如下:

{
    "under_game_score_y": 300,
    "press_coefficient": 1.393,
    "piece_base_height_1_2": 20,
    "piece_body_width": 70,
    "swipe": {
        "x1": 500,
        "y1": 1600,
        "x2": 500,
        "y2": 1602
    }
}

screenshot_20180102-231239

一直跳到了3000多分,不敢刷太高就停下来了