我想在没有找到图片之后重新在循环寻找,因为没学过这个语言,所以0基础,麻烦大佬们指导一下该怎么写了。谢谢大家,代码如下:
requestScreenCapture();
sleep(1000);
while(true){
var d = captureScreen();
var x = images.read("/storage/emulated/0/Pictures/Screenshots/Screenshot_20240222_094933.jpg");
var p = findImage(d,x);
if(p){
click(p.x,p.y);
sleep(500);
toast(p);
media.playMusic("/storage/emulated/0/Music/邵雨涵 - 快乐阿拉蕾.mp3");
sleep(30000);
break;
}else{
toast("没有找到图片");
sleep(3000)
}}
![](http://tiebapic.baidu.com/forum/w%3D580/sign=d0ad60f41466d0167e199e20a72bd498/83b965dce71190ef9fb071e6881b9d16fcfa60ca.jpg?tbpicau=2024-09-17-05_0b8d100bbff80a6649aa5555ce28763f)
requestScreenCapture();
sleep(1000);
while(true){
var d = captureScreen();
var x = images.read("/storage/emulated/0/Pictures/Screenshots/Screenshot_20240222_094933.jpg");
var p = findImage(d,x);
if(p){
click(p.x,p.y);
sleep(500);
toast(p);
media.playMusic("/storage/emulated/0/Music/邵雨涵 - 快乐阿拉蕾.mp3");
sleep(30000);
break;
}else{
toast("没有找到图片");
sleep(3000)
}}
![](http://tiebapic.baidu.com/forum/w%3D580/sign=d0ad60f41466d0167e199e20a72bd498/83b965dce71190ef9fb071e6881b9d16fcfa60ca.jpg?tbpicau=2024-09-17-05_0b8d100bbff80a6649aa5555ce28763f)