uglyer / wechat_jump_ai_kotlin

[防屏蔽] 微信小游戏 跳一跳 kotlin AI 并用 OpenCV 自动找起始点和目标点,使用 ADB 命令完成自动跳转.

Home Page:http://com.com.sb

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

wechat_jump_ai_kotlin


微信小游戏 跳一跳 kotlin AI 并用 OpenCV 自动找起始点和目标点,目标坐标,使用 ADB 命令完成自动跳转.

成果


特别说明


现在这个游戏似乎开始检测脚本了,不过检测的方式是检测触摸位置,现在加了随机触摸处区域,目前OK。

项目提交了 .idea 的原因是,太多人不会用了.

识别的方式比较简单,没太多精力搞这个 不再维护.

使用方法


  1. 在电脑上下载好adb.
  2. 打开安卓手机的usb调试模式并授权连接的电脑.
  3. 打开微信跳一跳,并点击开始.
  4. Constans.kt中配置好adb路径与截图路径,定时器时间、移动系数 可以根据实际情况适当调整.
  5. Constans.kt中配置设置起跳点的图像路径 文件在 pic/start.png.
  6. 运行 Main.kt 中的主函数(启用 OpenCv 需要添加VM参数 -Djava.library.path=F:\code\gua\wechat_jump_ai_kotlin\lib\x64)
  7. 会自动识别当前坐标和目标点,完成跳跃

跳一跳


微信小程序可以玩游戏了,我们来破解一下《跳一跳》这个官方出品的小游戏吧。

思路


用usb调试安卓手机,用adb截图并用 OpenCV 自动找起始点和目标点,测量距离,然后计算按压时间后模拟按压。

$ adb shell input swipe <x1> <y1> <x2> <y2> [duration(ms)] (Default: touchscreen) # 模拟长按
$ adb shell screencap <filename> # 保存截屏到手机
$ adb pull /sdcard/screen.png # 下载截屏文件到本地
  1. 得到手指按的时间 t
  2. 时间 = 距离 / 速度(常量) t = L / k
  3. L = p2 - p1
  4. 获取到起始点和结束点的坐标

源码


开发环境: Kotlin, IetelliJ IDEA

https://github.com/uglyer/wechat_jump_ai_kotlin

参考


https://github.com/easyworld/PlayJumpJumpWithMouse https://github.com/iOSDevLog/JumpJump

License


wechat_jump_ai_kotlin is released under the GPL V3 license. See LICENSE for details.

About

[防屏蔽] 微信小游戏 跳一跳 kotlin AI 并用 OpenCV 自动找起始点和目标点,使用 ADB 命令完成自动跳转.

http://com.com.sb


Languages

Language:Kotlin 100.0%