他们几个就一个特点,稳!!!所以推荐给大家,下面把代码分享给大家。
DY的:
auto.waitFor(); let see_count =300;// rawInput('请输入滑动次数','1000'); app.launchApp('抖音极速版'); sleep(4000); console.show(); //开启日志(悬浮窗权限) douYinyoungWin(); douYinCloseFriendTip(); for (var i = 1; i < see_count; i++) { toastLog("抖音极速版滑动" + i + '次'+"总计:"+ see_count + "次") randomUpSildeScreen(); randomDownSildeScreen(); randomFollow(); randomHeart(); slideScreenDown(device.width / 2, device.height*0.8, device.width / 2, device.height*0.1, 300); } //关闭当前程序 home(); /** * 关闭好友红包提示 */ function douYinCloseFriendTip(){ if(id("bap").exists()){ id("bap").findOnce().click(); } } /** * 屏幕向下滑动并延迟8至12秒 */ function slideScreenDown(startX, startY, endX, endY, pressTime) { swipe(startX, startY, endX, endY, pressTime); let delayTime = random(8000, 12000); sleep(delayTime); } /**如果弹出青少年窗口,点击 */ function douYinyoungWin() { if (youngWin = text("我知道了").exists()) { console.log("点击了我知道了(青少年窗口)"); youngWin.click(); }; } /** * 随机上滑(防止被判定是机器)上滑后停留时间至少是10S,造成假象表示是对内容感兴趣 * 点赞和关注先不搞。 */ function randomUpSildeScreen(){ let randomIndex = random(1, 40); if(randomIndex==1){ console.log("随机上滑被执行了"); pressTime = random(200, 500); swipe(device.width / 2, 500, device.width / 2, device.height-200, 700); delayTime = random(10000, 15000); sleep(delayTime); } } /** * 连续下滑对上一个无兴趣 * 其实得和上滑做个排他,既然无兴趣不要在上滑 */ function randomDownSildeScreen(){ let randomIndex = random(1, 50); if(randomIndex==1){ console.log("连续下滑被执行了"); swipe(device.width / 2, device.height-200, device.width / 2, 500, 700); sleep(2000); swipe(device.width / 2, device.height-200, device.width / 2, 500, 700); delayTime = random(8000, 10000); sleep(delayTime); } } /**随机点赞并休息一秒 */ function randomHeart() { index = random(1, 50); if (index == 6) { var target = id('a4l').findOnce(); if (target == null) { return; } else { target.click(); sleep(1000); console.log("随机点赞并休息一秒"); } } } /** * 随机关注 */ function randomFollow() { index = random(1, 100); if (index == 66) { var target = id('a4j').findOnce(); if (target == null) { return; } else { target.click(); sleep(1000); console.log("随机关注并休息一秒"); } } }
今日头条读新闻:
auto.waitFor(); app.launchApp('今日头条极速版'); var browseCount = 20; var columnName = "历史"; sleep(10000);//保障一下 /** * 今日头条读新闻 */ for (var i = 1; i <= browseCount; i++) { sleep(4000);//保障一下 toast("今日头条极速版读新闻第" + i + "次,共"+browseCount+"次"); if (className("android.widget.TextView").text("" + columnName + "").exists()) { let b = className("android.widget.TextView").text("" + columnName + "").findOnce().bounds();//推荐里面容易有广告 click(b.centerX(), b.centerY());//进入到栏目 browseNewsContent(); } } sleep(1500);//歇一会 toastLog("新闻读完"); function browseNewsContent() { sleep(6000);//保障一下 let news = id("bz").findOnce();//第二条新闻 if (news != null) { click(news.bounds().centerX(), news.bounds().centerY());//点击第二条新闻 for (var x = 1; x <= 20; x++) { toast("今日头条极速版读新闻第" + i + "次" + "滑动第" + x + "次"); swipe(303, 1200, 335, 150, 300); sleep(2000); } let textViews = className("android.widget.ImageView").clickable(true).find(); let b = textViews[0].bounds(); click(b.centerX(), b.centerY()); } }
火山和番茄我先不发,先发帖看看能不能给我XXX了。