本代码 是基于 auto.js
app软件:快手极速版
如果不熟悉 auto.js 请移步 auto.js文档
源码下载地址:暂无
auto.waitFor();
app.launchApp('快手极速版');
sleep(10000);
var CommentKeyWord = [
'评论内容1',
'评论内容2',
'评论内容3',
'评论内容4',
'评论内容5',
'评论内容6',
'评论内容7',
'评论内容8',
];
console.show(); //开启日志(悬浮窗权限)
console.info("快手极速版");
kuaiShouAutoComment();
home();//关闭当前程序
/**
* 自动评论
*/
function kuaiShouAutoComment() {
let comment = CommentKeyWord[Math.floor(Math.random() * CommentKeyWord.length)];
let buttons = className("android.widget.LinearLayout").id("comment_button").find();
if (buttons.length > 0) {
let clickResult = buttons[0].click();
if (clickResult) {
sleep(3000);
if (id("comment_editor_holder_text").exists()) {
id("comment_editor_holder_text").findOnce().click();
sleep(1000);
setText(0, comment);
sleep(1000);
if (text("发送").exists()) {
toastLog("开启自动评论");
if (text("发送").findOnce().click()) {
toastLog("自动评论成功");
back();
}
}
}
}
}
}