一、下载Autojs(自助从各大应用商店或浏览器下载)
二、复制下方代码,开 Autojs软件,导入打开抖音
function randomTime(min, max) { let time = random(min, max); return time * 1000; } function randomNum(min, max) { let time = random(min, max); return time; } function closeApp(packageName) { var name = getPackageName(packageName); if(!name){ if(getAppName(packageName)){ name = packageName; }else{ return false; } } app.openAppSetting(name); text(app.getAppName(name)).waitFor(); let is_sure = textMatches(/(.*强.*|.*停.*|.*结.*|.*行.*)/).findOne(); if (is_sure.enabled()) { click('结束运行'); textMatches(/(.*确.*|.*定.*)/).findOne().click(); log(app.getAppName(name) + "应用已被关闭"); sleep(2000); back(); sleep(3000); back(); } else { log(app.getAppName(name) + "应用不能被正常关闭或不在后台运行"); back(); } } function openDouyin() { log('----------------------'); sleep(randomTime(3,5)); log('启动抖音APP'); launch('com.ss.android.ugc.aweme'); //启动抖音APP sleep(randomTime(5, 7)); log('跳过广告'); click('跳过广告') sleep(randomTime(20,30)); click('以后再说'); //关闭更新弹窗 sleep(randomTime(5,7)); click('我知道了'); sleep(randomTime(5,7)); entry_user() } function do_task() { sleep(randomTime(5,8)); let i = 120; while (i > 0) { log('-----------休息中,关灯睡觉-----------') i -= 1; sleep(10000); } openDouyin(); } function entry_user() { scollor_video(4,12,1); id("emh").findOne().click(); sleep(randomTime(9,15)); click('作品'); sleep(randomTime(3,6)); let wid1 = randomNum(250, 450); let hig1 = randomNum(1200, 1450); let wid2 = randomNum(250, 450); let hig2 = randomNum(450, 600); let time1 = randomNum(300, 800); swipe(wid1, hig1, wid2, hig2, time1); sleep(randomTime(3,5)); let wid3 = randomNum(200, 700); let hig3 = randomNum(1100, 1400); click(wid3, hig3); sleep(randomTime(10, 20)); scollor_video(5,12,0); log('退出来'); back(); sleep(randomTime(5, 6)); back(); sleep(randomTime(7, 20)); scollor_video(5,15,1); let sui = randomNum(1,10); if (sui == 2 || sui == 5 || sui == 8) { id("jem").findOne().click(); //同城 sleep(randomTime(3, 6)); let wid3 = randomNum(100, 650); let hig3 = randomNum(300, 800); click(wid3, hig3); scollor_video(4,10,1); back(); sleep(randomTime(4, 6)); back(); } else if (sui == 1 || sui == 4 || sui == 7) { id("cfv").findOne().click(); //进入直播间 sleep(randomTime(7, 10)); scollor_video(4,8,0); back(); sleep(randomTime(3,5)); back(); sleep(randomTime(3,5)); } click('首页'); sleep(randomTime(5, 20)); scollor_video(4,12,1); back(); sleep(1000); back(); sleep(3000); closeApp('com.ss.android.ugc.aweme'); sleep(randomTime(5,8)); do_task(); } function scollor_video(min, max, feed) { let count = randomNum(min, max) log('本次滑动'+count+'个视频浏览'); while (count > 0) { toast('切换下一个视频'); log('切换下一个视频'); let wid1 = randomNum(250, 450); let hig1 = randomNum(1200, 1450); let wid2 = randomNum(250, 450); let hig2 = randomNum(450, 600); let time = randomNum(300, 800); swipe(wid1, hig1, wid2, hig2, time); sleep(randomTime(10, 25)); if ((count == 5 || count == 3 || count == 1) && feed == 1) { id("b19").findOne().click(); //点击评论 sleep(randomTime(4, 9)); swipe(wid1, hig1, wid2, hig2, time); sleep(randomTime(4, 9)); swipe(wid1, hig1, wid2, hig2, time); sleep(randomTime(4, 9)); back(); } else { sleep(randomTime(2, 10)); } count -= 1; } } function main() { //写入日志文件保存 console.setGlobalLogConfig({ "file": "/sdcard/脚本/meituan.txt" }); openDouyin(); } main();