Autojs4.1.0实战教程---火山极速版自动评论

火山极速版邀请码:279116054 看文章加关注点分享都不用...加下邀请码就好

今日头条极速版邀请码:1849623318  代码地址:https://blog.csdn.net/zy0412326/article/details/105011375

火山和今日头条都是字节跳动的,虽然给的不多但是一个字稳。推荐指数4颗星。
 

之前写过抖音的,虽然费劲不少也对后继写的提到帮助。今天写火山的比较顺利,分享给大家。

核心就是huoShanAutoComment方法。
————————————————

auto.waitFor();
app.launchApp('火山极速版');
sleep(10000);
var CommentKeyWord = [
    '我是抖音小助手关注了你你要关注我哦!',
    '山高路远坑深,大军纵横驰奔,谁敢横刀立马?惟有点赞加关注大军!',
    '我的未来不是梦我相信你也是',
    '身同感受',
];
console.show(); //开启日志(悬浮窗权限)
console.info("火山极速版");
huoShanAutoComment();
home();//关闭当前程序

/**
 * 自动评论
 */
function huoShanAutoComment(){
    let comment = CommentKeyWord[Math.floor(Math.random() * CommentKeyWord.length)];
    if(className("android.widget.RelativeLayout").desc("评论按钮").exists()){
        let b=className("android.widget.RelativeLayout").desc("评论按钮").findOnce().bounds();
        let clickResult= click(b.centerX(), b.centerY());
        if(clickResult){
            sleep(3000);
            setText(0,comment);
            sleep(3000);
            if (className("android.widget.TextView").text("发送").exists()) {
                toastLog("开启自动评论");
                if(className("android.widget.TextView").text("发送").findOnce().click()){
                    toastLog("自动评论成功");
                    back();
                }
            }
        }
    }
}
原创文章 74 获赞 42 访问量 2万+

猜你喜欢

转载自blog.csdn.net/zy0412326/article/details/105614026