Coder Social home page Coder Social logo

qiyue0726 / game-helper Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 0.0 7.85 MB

适用于部分游戏(如yys等)的简单自动化,解放双手,养生护肝。

License: GNU General Public License v3.0

Batchfile 2.80% Python 97.20%
python opencv pywin32

game-helper's Introduction

前言

该项目适用于大部分游戏的简单自动化,一定程度上可以达到养老护肝的效果。
项目内的截图和配置都适用于阴阳师,可以根据需要进行截图和相应的配置已适用于其它游戏。

特别感谢

LuffyLSX 的 auto-arknights 提供的图片识别技术;

jajajag 的 YYS-Helper 的项目架构参考;

警告: 不保证一定不会被系统检测到,造成的一切后果请自行承担。

使用方式

由于我使用的显示器是 2k(2560*1440) 的,所以如果你使用的是 1080P(1920*1080) 或其它分辨率的显示器,请修改 helper.py 中的 device_widthdevice_height

如果分辨率不同,除了修改文件外,还需要将游戏全屏,然后截图替换文件夹中的图片,一定要保存为 bmp 格式。

除此之外,还需要安装以下 python 库

pip install opencv-python pywin32 tqdm keyboard

配置文件说明

// 文件名一定要以 config_xxx.json 为命名
// 除说明必填外,其它参数可以设置为null或直接不写
// found 和 notFound 即为 if 和 else,必须至少存在其中一个
// found 目前的参数仅支持图片嵌套 和 填写数字 表示单击次数
// found 和 notFound 可以参考配置里面的协作和标记处理

{
    "path":"2k/yuhun/",         // 必填,截图的路径,在 images 文件夹里
    "timeCost": 5,              // 一个完整流程的最少耗时
    "endFlag":"img",            // 必填,一个流程的最后一个识别图
    "failFlag": "fail",         // 必填,一个流程失败的识别图
    "imgName":{                 // 需要识别的图片,img 为截图的文件名
        "similarity":0.95,      // 图片相似度,默认 0.9
        "found":1,              // 如果找到图片进行的操作,可进行嵌套,
        "notFound":null,        // 找不到图片进行的操作,可进行嵌套
        "offsetX":30,           // 点击的坐标和识别图左上角横坐标的偏移量,默认 0
        "offsetY":-30,          // 点击的坐标和识别图左上角纵坐标的偏移量,默认 0
        "delay":0.1,            // 每点击一次后睡眠时间,默认 0
        "checkAgain": 0,        // 是否重复检测,0 否
        "checkImg": "fighting"  // 不重复检测的图片
    }
}

game-helper's People

Contributors

qiyue0726 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  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.