AutoJS4.1.0实战教程 ---刷宝短视频

简介: AutoJS4.1.0实战教程 ---刷宝短视频


其实我写了很多心得。各位同仁其实我真心不推荐这个,给我封号了。。。。

推荐今日头条和火山他们2个都是字节跳动的给的不多但是不扯淡。

auto.waitFor();
let see_count =1000;// rawInput('请输入滑动次数',"3000");
app.launchApp('刷宝短视频');
sleep(4000);
console.show(); //开启日志(悬浮窗权限)
authorityCancleTip();//点击权限取消按钮
for (var i = 1; i < see_count; i++) {
    toast("刷宝短视频滑动" + i + '次');
    console.log("刷宝短视频滑动" + i + '次'+"总计:"+ see_count + "次");
    clickScreen();//解除正在直播的提示框
    shuabaoCloseAD();
    randomDownSildeScreen();
    randomHeart();
    randomFollow();
    slideScreenDown(device.width / 2, device.height-600, device.width / 2, 100, 700);
}
//退到主页面
home();
/**
 * 刷宝关闭广告
 */
function shuabaoCloseAD() {
    if (id("hotspot_imgdismiss").exists()) {
        id("hotspot_imgdismiss").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 clickScreen(){
    var x=device.width/2;
    var y=device.height/2-100;
    click(x, y);
}
function authorityCancleTip(){
    if(id("cancel").exists()){
        id("cancel").findOnce().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, 20);
    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, 10);
    if (index == 6) {
        var target = id('praise').findOnce();
        if (target == null) {
            return;
        } else {
            target.click();
            sleep(1000);
        }
    }
}
function randomFollow() {
    index = random(1, 10);
    if (index == 6) {
        var target = id('attention').findOnce();
        if (target == null) {
            return;
        } else {
            target.click();
            sleep(1000);
        }
    }
}

代码很简单我就不解释了。而且核心还有注释。

/**
 * 刷宝关闭广告
 */
function shuabaoCloseAD() {
    if (id("hotspot_imgdismiss").exists()) {
        id("hotspot_imgdismiss").findOnce().click();
    }
}

之前用autojs生成的报错!现在修改了一下。

 

目录
相关文章
|
2月前
AutoJS4.1.0实战教程---快刷短视频
AutoJS4.1.0实战教程---快刷短视频
47 1
|
2月前
AutoJs4.1.0实战教程---抖音极速版
AutoJs4.1.0实战教程---抖音极速版
127 0
|
2月前
Autojs4.1.0实战教程---秘乐短视频
Autojs4.1.0实战教程---秘乐短视频
37 0
|
2月前
AutoJS4.1.0实战教程 ---百度极速版
AutoJS4.1.0实战教程 ---百度极速版
92 0
|
2月前
Autojs4.1.0实战教程---中青看点
Autojs4.1.0实战教程---中青看点
60 0
|
2月前
Autojs4.1.0实战教程---抖音极速版自动评论
Autojs4.1.0实战教程---抖音极速版自动评论
130 1
|
2月前
|
区块链
AutoJs4.1.0实战教程---秘乐短视频
AutoJs4.1.0实战教程---秘乐短视频
36 0
|
2月前
AutoJS4.1.0实战教程 ---有颜短视频
AutoJS4.1.0实战教程 ---有颜短视频
30 1
|
2月前
AutoJS4.1.0实战教程 ---今日头条极速版
AutoJS4.1.0实战教程 ---今日头条极速版
93 1
|
2月前
AutoJs实战教程---刷宝短视频
AutoJs实战教程---刷宝短视频
26 0