当前位置:   article > 正文

autojs非按键精灵怎么做游戏脚本,来,给你游戏识图点击实例_autojs 图像识别模拟点击

autojs 图像识别模拟点击

用autojs做游戏而非按键精灵做怎么做,来,给你游戏识图点击实例

代码如下,脚本采取的是农药的爬塔脚本示范
**@更多基础加autojs交流群698307198喽;
一键加群:点击加群
和更多作者同群交流

//王者 自动爬塔
requestScreenCapture();
for (var i = 1; i > 0; i++) {

var 开战 = images.read("./开战.jpg");

//截图并找图
var p = findImage(captureScreen(),开战,{
    region: [0, 50],
    threshold: 0.8
});
if(p){
    toast("开战成功");
    click( + p.x , + p.y);
} else{
    print("没找到")
}
sleep(1000);
var 布阵 = images.read("./布阵.jpg");

//截图并找图
var p = findImage(captureScreen(),布阵,{
    region: [0, 50],
    threshold: 0.8
});
if(p){
    toast("布阵成功");
    click( + p.x , + p.y);
} 
sleep(1000);
var 再开战 = images.read("./再开战.jpg");
var p = findImage(captureScreen(),再开战,{
    region: [0, 50],
    threshold: 0.8
});
if(p){
    toast("再开战成功");
    click( + p.x , + p.y);
} 
sleep(1000);
var 挑战 = images.read("./挑战.jpg");

//截图并找图
var p = findImage(captureScreen(),挑战,{
    region: [0, 50],
    threshold: 0.8
});
if(p){
    toast("挑战成功");
    click( + p.x , + p.y);
} 
sleep(1000);
var 确定 = images.read("./确定.jpg");

//截图并找图
var p = findImage(captureScreen(),确定,{
    region: [0, 50],
    threshold: 0.8
});
if(p){
    toast("确定成功");
    click( + p.x , + p.y);
} 
}



//什么,你还要图片?果然是,小孩才做选择,大人说我全都要
完整源码下载:https://www.lanzoui.com/b005gkk5c](https://www.lanzoui.com/b005gkk5c)
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
本文内容由网友自发贡献,转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号