//找图找色在找到后要用 recycle() 来对创建的图像对象回收
auto.waitFor()
auto.setMode("fast")
console.show()
if(!requestScreenCapture()){
toast("请求截图失败");
exit();
}
//申请截图权限
sleep(2000)
//开启权限后过一段时间才能成功截取
console.log(wzsb());
function wzsb(){
var client_id = "";
//API Key
var client_secret = "";
//Secret Key
var baidukey = "&client_id="+ client_id +"&client_secret="+ client_secret;
var as = http.get("https://aip.baidubce.com/oauth/2.0/token?grant_type=client_credentials" + baidukey);
as = as.body.json();
var token = as.access_token;
var img = captureScreen();
//截屏
img = images.clip(img, 60, 634, 200, 100)
var imageBase64 = images.toBase64(img);
//截取图片的一部分并转换格式
img.recycle()
var res = http.post("https://aip.baidubce.com/rest/2.0/ocr/v1/accurate_basic?access_token=" + token,{headers:{
'Content-Type