封装函数
function clicktext(t){
if(text(t).findOne(2000)){
let b_x = Number(text(t).findOne(2000).bounds().left+2);
let b_y = Number(text(t).findOne(2000).bounds().right-2);
let b_t = Number(text(t).findOne(2000).bounds().top + 2);
let b_b = Number(text(t).findOne(2000).bounds().bottom-2);
let c_x = random(b_x,b_y);
let c_y = random(b_t,b_b);
click(c_x, c_y);
sleep(1000);
}
}
使用函数
clicktext("这里写需要点击的文本")