找图
//请求截图,用找图方法,第一个就要先写的请求截图代码,不然找图没法用
if (!requestScreenCapture()) {
toast("请求截图失败");
exit();
}
let 大图 = captureScreen()
let 小图 = images.read("/sdcard/微信.png"); //括号里是图片地址。。
let result = images.matchTemplate(大图, 小图, {
max: 5
});
if (result != null) {
for (let i = 0; i < result.matches.length; i++) {
let pp = result.matches[i].point
// log(pp)
let xx = random(pp.x, pp.x + 小图.getWidth())
let yy = random(pp.y, pp.y + 小图.getWidth())
console.log("找到" + "每日空投")
click(xx, yy)
console.log("点击" + "每日空投")
sleep(2000)
// break;
}
}