level 3
muji😘😘
楼主
求助
requestScreenCapture();
for (var i = 1; i > 0; i++)
{ { {
sleep(1000);
click(1721,432);//点击斥候营
sleep(1000);
click(1794,655);//探索
sleep(1000);
}
var 开战 = images.read("/sdcard//sdcard/a.png");
//截图并找图
var p = findImage(captureScreen(),开战,{
region: [0,0],
threshold:0.8
});
if(p){
toast("找到了");
click( + p.x , + p.y);
}
else
{
toast("没找到");
}}
sleep(2000);
var 探索 = images.read("/sdcard//sdcard/b.jpg");
//截图并找图
var p = findImage(captureScreen(),探索,{
region: [854, 19],
threshold:0.9
});
sleep(1000);
if(p){
toast("找到了");
click( + p.x , + p.y);
}
sleep(1000);
var 派遣= images.read("/sdcard//sdcard/派遣.png");
//截图并找图
var p = findImage(captureScreen(),派遣,{
region: [1491, 33],
threshold: 0.8
});
sleep(1000);
if(p){
toast("找到了");
sleep(1000);
click( + p.x , + p.y);
// sleep(2000);
//click(165,982);//回城
// sleep(1000);
// click(1721,432);//点击斥候营
}
else
{
toast("没找到");
}}
截图循环找图判断点击,但是只有第一个图能找到,为啥?求大佬帮帮
2020年10月25日 17点10分
1
requestScreenCapture();
for (var i = 1; i > 0; i++)
{ { {
sleep(1000);
click(1721,432);//点击斥候营
sleep(1000);
click(1794,655);//探索
sleep(1000);
}
var 开战 = images.read("/sdcard//sdcard/a.png");
//截图并找图
var p = findImage(captureScreen(),开战,{
region: [0,0],
threshold:0.8
});
if(p){
toast("找到了");
click( + p.x , + p.y);
}
else
{
toast("没找到");
}}
sleep(2000);
var 探索 = images.read("/sdcard//sdcard/b.jpg");
//截图并找图
var p = findImage(captureScreen(),探索,{
region: [854, 19],
threshold:0.9
});
sleep(1000);
if(p){
toast("找到了");
click( + p.x , + p.y);
}
sleep(1000);
var 派遣= images.read("/sdcard//sdcard/派遣.png");
//截图并找图
var p = findImage(captureScreen(),派遣,{
region: [1491, 33],
threshold: 0.8
});
sleep(1000);
if(p){
toast("找到了");
sleep(1000);
click( + p.x , + p.y);
// sleep(2000);
//click(165,982);//回城
// sleep(1000);
// click(1721,432);//点击斥候营
}
else
{
toast("没找到");
}}
截图循环找图判断点击,但是只有第一个图能找到,为啥?求大佬帮帮