AutoJS4.1.0实战教程 ---彩蛋视频

简介: AutoJS4.1.0实战教程 ---彩蛋视频

推荐指数:3颗星

彩蛋视频这个也是我比较稀饭得一个。金蛋自动给,只要简单得刷一下就好。代码也没买啥难度,最近做了点优化,可以阅读广告多领取点金币。

直接上代码,这些代码我都经过测试的可以直接使用。

auto.waitFor();//判断和等待开启无障碍
let see_count = 1000;//rawInput('请输入滑动次数','1000');//手动输入滑动次数默认是1000次。
console.show(); //开启日志(悬浮窗权限)
console.info("启动彩蛋视频");
app.launchApp('彩蛋视频');//只有一个快手极速版所以直接Launch就可以,不用包名
sleep(10000);//等待splash时间
for (var i = 1; i < see_count; i++) {
    toastLog("彩蛋视频滑动" + i +  "次"+"总计:"+ see_count + "次");//系统自带目前我huweinova不显示还不知道为啥
    getCoinWateTime();
    caiDanCloseGoderEggTip();
    randomUpSildeScreen();//模仿人类随向上滑动一次,表示对这个视频有兴趣
    randomDownSildeScreen();//模仿人类随连续下滑2次,表示对当前视频无兴趣
    randomHeart();//模仿人类随随机点赞
    randomFollow();//模仿人类随随机关注
    slideScreenDown(device.width / 2, device.height - (device.height * 0.2), device.width / 2, device.height * 0.05, 400);
}
//关闭当前程序
home();//回到首页
exits();//退出js脚本
function getCoinWateTime(){
    //id = tv_ad_red_pack_count_down
    if(className("android.widget.TextView").id("tv_ad_red_pack_count_down").exists()){
        sleep(30000);
        if(className("android.widget.TextView").text("立即领取").exists()){
            console.info("领取金币");
            className("android.widget.TextView").text("立即领取").findOnce().click();
        }
    }
}
function caiDanCloseGoderEggTip() {
    if (id("close_bottom_button").exists()) {
        try {
            console.log("关闭金蛋提示框");
            id("close_bottom_button").findOnce().click();
        } catch (e) {
            console.log(e);
        }
    }
}
/**
 * 关闭通知
 */
function kuaiShouCloseInvitationNotice(){
    if(className("android.widget.ImageButton").id("close").exists()){
        className("android.widget.ImageButton").id("close").findOnce().click();
    }
}
/**
 * 快手关闭是否喜欢对话框
 */
function kuaiShouCloseIsLike(){
    if(className("android.widget.TextView").text("不影响").exists()){
        className("android.widget.TextView").text("不影响").findOnce().click();
    }
} 
/**
 * 屏幕向下滑动并延迟8至12秒
 */
function slideScreenDown(startX, startY, endX, endY, pressTime) {
    swipe(startX, startY, endX, endY, pressTime);
    let delayTime = random(8000, 12000);
    sleep(delayTime);//模仿人类随机时间
}
/**
 * 随机上滑(防止被判定是机器)上滑后停留时间至少是10S,造成假象表示是对内容感兴趣
 * 点赞和关注先不搞。
 */
function randomUpSildeScreen(){
    let randomIndex = random(1, 50);
    if(randomIndex==1){
        console.log("快手极速版随机上滑被执行了!!!");
        pressTime = random(200, 500);
        swipe(device.width / 2, device.height - (device.height * 0.2), device.width / 2, device.height * 0.05, 400);
        delayTime = random(10000, 15000);
        sleep(delayTime);
    }
}
/**
 * 连续下滑对上一个无兴趣
 * 其实得和上滑做个排他,既然无兴趣不要在上滑
 */
function randomDownSildeScreen(){
    let randomIndex = random(1, 50);
    if(randomIndex==1){
        console.log("连续下滑被执行了");
        swipe(device.width / 2, device.height - (device.height * 0.2), device.width / 2, device.height * 0.05, 400);
        sleep(2000);
        swipe(device.width / 2, device.height - (device.height * 0.2), device.width / 2, device.height * 0.05, 400);
        delayTime = random(8000, 10000);
        sleep(delayTime);
    }
}
/**随机点赞并休息一秒 */
function randomHeart() {
    index = random(1, 3);
    if (index == 1) {
        if(id("ll_like_show_btn").exists()){
            let clickResult=id('ll_like_show_btn').findOnce().click();
            if(!clickResult){
                let b=id("ll_like_show_btn").findOnce().bounds();
                click(b.centerX(),b.centerY());
            }
        }
    }
}
/**
 * 随机关注
 */
function randomFollow(){
    index = random(1, 3);
    if (index == 1) {
        if(id("btn_follow_view").exists()){
            let clickResult=id('btn_follow_view').findOnce().click();
            if(!clickResult){
                let b=id("btn_follow_view").findOnce().bounds();
                click(b.centerX(),b.centerY());
            }
        }
    }
}

 

目录
相关文章
|
4月前
|
缓存
Autojs4.1.0实战教程---彩蛋视频功能合集
Autojs4.1.0实战教程---彩蛋视频功能合集
27 0
|
4月前
AutoJS4.1.0实战教程 ---疯读小说
AutoJS4.1.0实战教程 ---疯读小说
26 0
|
4月前
AutoJS4.1.0实战教程 ---快音
AutoJS4.1.0实战教程 ---快音
39 0
|
4月前
AutoJS4.1.0实战教程 ---七猫免费小说
AutoJS4.1.0实战教程 ---七猫免费小说
39 0
|
4月前
Autojs4.1.0实战教程---中青看点
Autojs4.1.0实战教程---中青看点
37 0
|
4月前
AutoJs4.1.0实战教程---抖音极速版
AutoJs4.1.0实战教程---抖音极速版
82 0
|
4月前
AutoJS4.1.0实战教程 ---百度极速版
AutoJS4.1.0实战教程 ---百度极速版
64 0
|
4月前
|
JavaScript 数据安全/隐私保护 Android开发
AutoJs4.1.0实战教程---源码大放送
AutoJs4.1.0实战教程---源码大放送
49 0
|
4月前
|
编解码
AutoJs4.1.0实战教程---最后惊喜的一篇
AutoJs4.1.0实战教程---最后惊喜的一篇
21 0
|
4月前
AutoJs4.1.0实战教程---抖音极速版点赞加关注代码
AutoJs4.1.0实战教程---抖音极速版点赞加关注代码
47 0

相关实验场景

更多