Giter VIP home page Giter VIP logo

wechat_jump_ai_kotlin's Introduction

wechat_jump_ai_kotlin


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

成果


特别说明


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

使用方法


  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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.