[JavaScript] 纯文本查看 复制代码/*全部关注 QuanBuGuanZhu()
@起始页面:用户的粉丝列表页
@小米4c,安卓7,抖音11.6.0版本,测试通过
@20200702有效
*/

events.setKeyInterceptionEnabled("volume_up", true);
events.observeKey();
events.onKeyDown("volume_up", () => {
toastLog(\’按音量上键停止脚本\’);
exit();
});

threads.start(function () {
QuanBuGuanZhu()
});

function QuanBuGuanZhu() {
var n = 1
while (true) {
guanZhu()
// 翻页
id("et7").className("android.support.v7.widget.RecyclerView").scrollable(true).findOne().scrollForward()
toastLog("翻页中,程序正在运行,已关注" + n + "人!")
sleep(random(12000, 20000))

if (n >= 200) {
toastLog("已关注" + n + "人,即将退出!")
break
}

}

function guanZhu() {

let object = id("zs").className("android.widget.TextView").text("关注").find()
object.forEach(function (currentValue) {
currentValue.click();
toastLog("已关注" + n + "人!")
n = n + 1
sleep(random(12000, 20000))
})

}

}