Code Monkey home page Code Monkey logo

node-opencv-adb's Introduction

node-opencv-adb

没错,这三个东西组合在一起就是用来干你所想的那种事情。

adb 那个裤子,需要当前运行环境下直接敲 adb 有反应,请自行配置环境。

opencv 那玩意,国内使用的话使用国内镜像源

$ cat .gitconfig
[user]
        name = undownding
        email = [email protected]
[url "https://gitee.com/mirrors"]
        insteadOf = https://github.com/opencv

使用方式:

npm install
babel-node ./main.js

结构说明

start.cmd

因为这玩意我使用 wsl 里的 babel-node 来跑,然后把 cmd 作为 Windows 自带的计划任务的启动器,所以写了这玩意

control 目录

一些调用 adb 对模拟器进行基础操作的脚本,默认不需要改动。

back.js     - 模拟 back 按键
connect.js  - 连接到模拟器,端口号可酌情修改
find.js     - 查找某个模板图片在截图中是否存在,需手动调用 screencap() 并传入截图路径
home.js     - 模拟 home 按键
screencap.js - 截图并保存到当前目录的 screenshot.png
sleep.js     - 顾名思义
tap.js       - 模拟点击某个坐标
touch.js     - 查找某个元素并点击

actions 目录

自定义一些对游戏的基础操作

scripts 目录

自定义一些高级/复杂的脚本操作,可以稍微参考一下。

其中 launchMuMu.js 为启动 Windows 下的 MuMu 模拟器,因为环境配置导致的路径不同,若直接使用请修改。

templates 目录

存放一些图像模板,请注意使用自定义模板时用 adb shell screencap -p 来生成截图再裁剪。

总之目录划分没有很严格的规则,只要能让 main.js 调用到怎么写都没问题。

node-opencv-adb's People

Contributors

undownding avatar

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.