基于autojs7的亚丁号成语大家族辅助

简介: 基于autojs7的亚丁号成语大家族辅助

源码和apk文件:成语大家族.rar - 蓝奏云

最近成语大家族非常火爆,火爆的原因就是收益高呗。所以我也参与了一下写了个辅助自己刷刷刷了一下感觉还可以。主要有这么几个简单的功能:

  1. 自动抢红包
  2. 自动看ad
  3. 自动关闭ad和返信息
  4. 自动提现

 

 

 

此软件是使用autojs pro 7编写的,虽然7这个破解版不是很好,但是支持找图,还是使用了。本次核心技术就是找图我自己编写的方法还不错支持多个图片一起找。

核心代码

找图方法

/**
 * 找图,找到并点击
 * @param {可以是数组也可以是字符串,传输数组可以多次找图知道找到为止} img_path_array 
 * @param {找图区域,默认是全屏找图,该参数可以不传输} area_region 
 * @param {相似度,默认是0.8,可以不传输} threshold 
 * @returns true表示执行成功Flase表示失败
 */
Tools.clickAreaForFindImage=function(img_path_array, area_region, threshold,is_continue) {
    try {
        area_region = area_region || [0, 0, device.width, device.height] //默认的找图区域 全屏找图 前2位是坐标 后面是长度和宽度   千万别理解成是坐标
        threshold = threshold || 0.8 // 默认的相识度0.8
        is_continue=is_continue|| false
        if (img_path_array instanceof Array) {
            let arrayLength = img_path_array.length
            for (let i = 0; i < arrayLength; i++) {
                //toastLog("正在进行第" + (i + 1) + "次找图...")
                img_path = img_path_array[i] //小图地址可判断是否存在
                if (!files.exists(img_path)) {
                    toastLog(img_path + "文件不存在因此跳过")
                    continue
                }
                var little_image = images.read(img_path) //小图
                var find_result_bounds = findImage(
                    captureScreen(), little_image, {
                    region: area_region,
                    threshold: threshold
                });
                if (find_result_bounds) {
                    toastLog(img_path+"图找到,准备点击坐标:" + find_result_bounds)
                    click(find_result_bounds.x, find_result_bounds.y)
                    return true
                } else {
                    //toastLog(img_path+"小图存在但是在大图中未找到图片进入下一次循环...")
                }
            }
            return false
        }
        if (typeof (img_path_array) == "string") {
            img_path = img_path_array//小图地址可判断是否存在
            if (!files.exists(img_path)) {
                toastLog(img_path + "文件不存在因此跳过")
                return false
            }
            var little_image = images.read(img_path) //小图
            var find_result_bounds = findImage(
                captureScreen(), little_image, {
                region: area_region,
                threshold: threshold
            });
            if (find_result_bounds) {
                toastLog(img_path+"图找到,准备点击坐标:" + find_result_bounds)
                click(find_result_bounds.x, find_result_bounds.y)
                return true
            } else {
                //toastLog(img_path + "小图存在但是在大图中未找到图片")
                return false
            }
        }
    } catch (error) {
        toastLog("clickAreaForFindImage方法出现错误:" + error)
        return false;
    }
}
Tools.clickRegionForFindImage=function(img_path_array, area_region, threshold,is_continue) {
    try {
        area_region = area_region || [0, 0, device.width, device.height] //默认的找图区域 全屏找图 前2位是坐标 后面是长度和宽度   千万别理解成是坐标
        threshold = threshold || 0.9 // 默认的相识度0.85
        is_continue=is_continue|| false
        if (img_path_array instanceof Array) {
            let arrayLength = img_path_array.length
            for (let i = 0; i < arrayLength; i++) {
                img_path = img_path_array[i] //小图地址可判断是否存在
                if (!files.exists(img_path)) {
                    toastLog(img_path + "文件不存在因此跳过")
                    continue
                }
                var little_image = images.read(img_path) //小图
                var find_result_bounds = images.matchTemplate(
                    captureScreen(), little_image, {
                    region: area_region,
                    threshold: threshold,
                    max: 100
                });
                if (find_result_bounds) {
                    find_result_bounds.matches.forEach(match => {
                        log(img_path+"point = " + match.point + ", similarity = " + match.similarity);
                        click(match.point.x, match.point.y)
                    });
                    if(is_continue || is_continue=="true"){
                        continue;
                    }
                    return true
                } else {
                    //toastLog(img_path + "小图存在但是在大图中未找到图片进入下一次循环...")
                }
            }
            return false
        }
        if (typeof (img_path_array) == "string") {
            img_path = img_path_array//小图地址可判断是否存在
            if (!files.exists(img_path)) {
                toastLog(img_path + "文件不存在因此跳过")
                return false
            }
            var little_image = images.read(img_path) //小图
            var find_result_bounds = images.matchTemplate(
                captureScreen(), little_image, {
                region: area_region,
                threshold: threshold,
                max: 100
            });
            toastLog(find_result_bounds)
            if (find_result_bounds) {
                //toastLog(img_path + "图找到,准备点击坐标:" + find_result_bounds)
                click(find_result_bounds.x, find_result_bounds.y)
                return true
            } else {
                //toastLog(img_path + "小图存在但是在大图中未找到图片")
                return false
            }
        }
    } catch (error) {
        toastLog("clickRegionForFindImage方法出现错误:" + error)
        return false;
    }
}

整个工程截图:

项目文件和压缩文件内容:

源码和apk文件:成语大家族.rar - 蓝奏云

感谢您的支持

学习知识费力气,

收集整理更不易。

知识付费甚欢喜,

为咱码农谋福利。

目录
相关文章
|
3月前
|
缓存 Android开发
基于autojs7的爆音极速版辅助
基于autojs7的爆音极速版辅助
17 0
|
3月前
|
缓存 Android开发
基于autojs7的皮皮虾极速版辅助
基于autojs7的皮皮虾极速版辅助
25 1
|
3月前
|
缓存 Android开发
基于autojs7的元宝视频极速版辅助
基于autojs7的元宝视频极速版辅助
19 0
|
3月前
|
缓存 Android开发
基于autojs7的亚丁号点淘辅助
基于autojs7的亚丁号点淘辅助
52 0
|
3月前
|
缓存 Android开发
基于autojs7的番茄免费小说辅助
基于autojs7的番茄免费小说辅助
64 0
|
3月前
|
区块链
基于AutoJs4实现的陀螺世界辅助
基于AutoJs4实现的陀螺世界辅助
29 0
|
3月前
基于autojs7的筷子免费小说辅助
基于autojs7的筷子免费小说辅助
15 1
|
7月前
|
Android开发 Windows
汪子熙趣味成语接龙的游戏软件使用文档说明
汪子熙趣味成语接龙的游戏软件使用文档说明
50 0
|
7月前
|
人工智能 自然语言处理 算法
视频剪辑中花式抠图的代码实操与案例详述
本文为阿里云智能媒体服务 IMS「云端智能剪辑」现高效、便捷的视频制作及合成体验。
110 0
|
11月前
|
机器学习/深度学习 人工智能 计算机视觉
生成视频如此简单,给句提示就行,还能在线试玩
生成视频如此简单,给句提示就行,还能在线试玩

热门文章

最新文章