device.wakeUp(); //唤醒设备 device.keepScreenOn(); //屏幕常亮 auto.waitFor(); var height = device.height; var width = device.width; toast("\n设备宽" + width + "\n" + "设备高" + height + "\n" + "手机型号" + device.model + "\n安卓版本" + device.release) app.launchApp("小龙虾"); toastLog("打开小龙虾"); toast(height) var i =0 if (height == 1920) { //设置脚本坐标点击所适合的屏幕宽高。 setScreenMetrics(1080, 1920); toast("设备高" + height); while (i < 500) { dianzan(); i++; } } else if (height == 2340) { setScreenMetrics(1080, 2340); toast("设备高" + height); while (i < 500) { dianzan(); i++; } } else if (height == 2158) { setScreenMetrics(1080, 2160); toast("设备高" + height); while (i < 500) { dianzan(); i++; } } function dianzan() { while (text("暂时没有任务").exists()) { sleep(1000); //click(636, 1332);//刷新 click(762,1495) sleep(2000); } click(700, 1137);//点赞按钮 sleep(2000); toast("展开点赞"); if(!text("复制").exists()){ toast("未有效展开"); click(685,1311) if(!text("复制").exists()){ return; } } text("复制").click() sleep(300); if(text("任务无效").exists()){ toast("任务无效"); return; } toast("点赞"); //第一个点赞 sleep(3000) launchApp("抖音短视频"); sleep(2000); click(634,1515); //前往 sleep(2000); click(965, 1054); //点赞 sleep(1500); launchApp("小龙虾"); sleep(2000); }