用autojs做遊戲而非按鍵精靈做怎麼做,來,給你遊戲識圖點擊實例
代碼如下,腳本採取的是農藥的爬塔腳本示範
更多內容請加交流羣553908361
和更多作者同羣交流
//王者 自動爬塔
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://lanzous.com/id7hw5e