🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
//控件点击 ``` function 控件点击(dshuxing, dzhi, dname) {     var a = dshuxing(dzhi).boundsInside(0, 0, device.width, device.height).findOnce();     if (a != null) {         var x1 = a.bounds().left;         var x2 = a.bounds().right;         var y1 = a.bounds().top;         var y2 = a.bounds().bottom;         var x = random(Math.floor(x1 + 1), Math.floor(x2 - 1));//删除控件四周1的边界,防止边框位置点击无效         var y = random(Math.floor(y1 + 1), Math.floor(y2 - 1));         var timedelay = random(50, 150);         toastLog("点击 [" + dname + "]");         press(x, y, timedelay);         sleep(1000);         return true;     } else {         toastLog("无法找到 [" + dname + "]");         //其他内容     } } ``` ``` // 1.打开app app.launchApp("轻抖"); console.log("打开app"); sleep(3330); // 2.进入引流任务 //var 引流任务=className("android.view.ViewGroup").depth(4).drawingOrder(3).indexInParent(3).findOnce(); var 引流任务=className("android.view.ViewGroup").depth(15).drawingOrder(3).indexInParent(3).findOnce(); if(引流任务){ 引流任务.click(); console.log("进入引流任务"); sleep(1110); } if(text("任务大厅").findOnce()){ 控件点击(id,"com.qingdou.android:id/tvNotApply","未报名任务") } while(){ // 3.去赚钱 控件点击(text,"去赚钱","点击--去赚钱") 控件点击(text,"3786456464","接新单") // 第二个参数要跟实际情况填写 //控件点击(text,"","") // 4.返回 if(text("留下你的精彩评论吧").findOnce()){ console.log("在抖音界面"); sleep(random(11000,13000)); console.log("即将返回轻抖界面"); app.launchApp("轻抖"); } // 5.报名其他任务 控件点击(text,"报名其他任务","报名其他任务") } ``` ``` function 检测app页面(包名) { let 软件名 = app.getAppName(包名) if (currentPackage != 包名) { console.info("不在--" + 软件名 + "--app页面"); if (currentPackage != 包名) { app.launchPackage(包名); console.info("返回--" + 软件名 + "--app"); sleep(3000); } } } ``` ``` function 随机向上滑动() { var x1= random(device.width/4,(device.width/4)*3); var y1= random((device.height/4)*3.25,(device.height/4)*3.5); var x2= random(device.width/4,(device.width/4)*3); var y2= random((device.height/4)*0.5,(device.height/4)*0.75); let randomIndex = random(1,1); if (randomIndex == 1) { swipe(x1, y1, x2, y2, random(800,1000)); console.log("随机向上滑动"); sleep(random(1000,1500)); } } function 随机向下滑动() { var x1= random(device.width/4,(device.width/4)*3); var y1= random((device.height/4)*3.25,(device.height/4)*3.5); var x2= random(device.width/4,(device.width/4)*3); var y2= random((device.height/4)*0.5,(device.height/4)*0.75); let randomIndex = random(1,1); if (randomIndex == 1) { swipe(x2, y2, x1, y1, random(800,1000)); console.log("随机向下滑动"); sleep(random(1000,1500)); } } ```