AutoJS4.1.0实战教程 ---百度极速版

简介: AutoJS4.1.0实战教程 ---百度极速版

薅羊毛无处不在就连百度咱也不放过,收益虽然不高但是也值得一刷。百度有个小限制每天得先签到,要不然不给金币,签到我还在测试大家先用着刷新闻、刷视频和刷小视频吧。

auto.waitFor();
app.launchApp('百度极速版');
sleep(10000);//等待加载
swipe(device.width / 2, device.height / 2, device.width / 2, device.height - 200, 300);
sleep(2000);//等待加载
/**
 * 百度极速版读新闻
 */
for (var i = 0; i < 15; i++) {
    let views = className("android.widget.TextView").find();
    var b = null;
    var arrayIndex = new Array();
    for (let i = 0; i < views.length; i++) {
        let news = views[i].findOne(id("ah6"));
        if (news != null) {
            arrayIndex.push(i);
        }
    }
    b = views[arrayIndex[1]].bounds();//获取第2个新闻第一个经过测试发现基本不更新
    if (b != null) {
        click(b.centerX(), b.centerY());
    }
    for (var x = 0; x < 8; x++) {
        swipe(303, 1100, 335, 200, 200);
        sleep(2000);
    }
    className("android.widget.RelativeLayout").desc("返回").findOne().click()
    sleep(1000);
    swipe(device.width / 2, 700, device.width / 2, device.height - 200, 1000);
    sleep(3000);
}
/**
 * 百度极速版看抗击肺炎
 */
// if(id("aoc").className("android.widget.TextView").text("抗击肺炎").exists()){
//     id("aoc").className("android.widget.TextView").text("抗击肺炎").findOnce().click();
//     swipe(303, 1100, 335, 200, 800);
//     sleep(2000);
//     let views = className("android.widget.TextView").find();
//     for (let i = 0; i < views.length; i++) {
//         let news = views[i].findOne(id("ah6"));
//         if (news != null) {
//             click(news.bounds().centerX(), news.bounds().centerY());
//             sleep(3000);
//         }
//     }
// }
/**
 * 百度极速版看视频
 */
let videos1 = id("b74").className("android.widget.TextView").text("好看视频").findOne();
if (videos1 != null) {
    videos1.parent().click();
    sleep(3000);//等待加载
}
for (let i = 0; i < 2; i++) {
    let play_button = id("azb").findOnce();
    play_button.click();
    sleep(10000);
    let videos2 = id("b74").className("android.widget.TextView").text("好看视频").findOne();
    if (videos2 != null) {
        videos2.parent().click();
        sleep(5000);//等待加载
    }
}
/**
 * 百度极速版看小视频
 */
let videos = id("b74").className("android.widget.TextView").text("好看视频").findOne();
if (videos != null) {
    videos.parent().click()
    console.log("点击好看视频......");
    sleep(3000);//等待加载
}
let betuifulVideo = id("aoc").className("android.widget.TextView").text("小视频").findOne();
if (betuifulVideo != null) {
    betuifulVideo.click();
    sleep(1000);//等待加载
}
var x = device.width / 4;
var y = device.height / 2;
click(x, y);//点击第3个视频
sleep(6000);//看6秒
i = 1;
for (var i = 1; i < 30; i++) {
    toast("百度极速版好看视频滑动" + i + '次')
    console.log("百度极速版好看视频滑动" + i + '次');
    var x = device.width / 2;
    var y = device.height / 2;
    click(x, y);//防止没点上
    randomDownSildeScreen();
    randomHeart();
    randomFollow();
    pressTime = random(250, 600);
    swipe(303, 1328, 335, 71, pressTime);
    delayTime = random(5000, 10000);
    sleep(delayTime);
}
exit();
home();
/**
 * 随机上滑(防止被判定是机器)上滑后停留时间至少是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, 100);
    if (index == 66) {
        var target = id('ob').findOnce();
        if (target == null) {
            return;
        } else {
            target.click();
            sleep(1000);
        }
    }
}
function randomFollow() {
    index = random(1, 100);
    if (index == 66) {
        var target = id('ov').findOnce();
        if (target == null) {
            return;
        } else {
            target.click();
            sleep(1000);
        }
    }
}

 

目录
相关文章
|
2月前
|
数据采集 Python
爬虫实战-Python爬取百度当天热搜内容
爬虫实战-Python爬取百度当天热搜内容
72 0
|
3月前
|
Kubernetes 应用服务中间件 nginx
百度搜索:蓝易云【使用Kubernetes部署Nginx应用教程】
现在,你已经成功在Kubernetes集群上部署了Nginx应用。通过访问Service的外部IP地址,你可以访问Nginx服务。
42 4
|
3月前
|
Ubuntu
百度搜索:蓝易云【Ubuntu开机自启服务systemd.service配置教程】
现在,你的服务将在Ubuntu开机时自动启动,并在之后的启动中持续运行。记得根据你的实际需求修改 `your_service_name.service`文件中的相关信息。
57 2
|
3月前
|
网络安全 数据中心
百度搜索:蓝易云【Proxmox软件防火墙的配置教程】
现在,你已经完成了Proxmox软件防火墙的配置。请确保你的防火墙规则设置正确,以保护你的Proxmox VE环境免受未经授权的访问和网络攻击。
129 5
|
4月前
|
Ubuntu
百度搜索:蓝易云【ubuntu 16.04升级到18.04教程】
请注意,在升级过程中可能会出现一些问题,例如软件包依赖关系或配置文件冲突。在升级前,建议备份重要数据,以免数据丢失。如果你在升级过程中遇到问题,可以查看相关错误信息并尝试解决。
47 2
|
4月前
|
Ubuntu 数据安全/隐私保护
百度搜索:蓝易云【ubuntu安装qemu教程】
现在,你已经成功在Ubuntu系统中安装了QEMU。你可以使用QEMU来模拟x86、ARM等体系结构的虚拟机,并在其中运行不同的操作系统。请注意,QEMU的使用可能涉及到一些复杂的参数和配置,具体使用方法可以参考官方文档或相关教程。
53 1
|
4月前
|
Ubuntu Linux 数据安全/隐私保护
百度搜索:蓝易云【ubuntu系统安装gcc-7、g++-7教程】
请注意,以上步骤是针对Ubuntu系统的。如果你使用的是其他Linux发行版,请相应地调整命令。
109 6
|
4月前
|
Ubuntu 关系型数据库 MySQL
百度搜索:蓝易云【ubuntu下Mysql安装与root密码重置教程】
请注意,以上步骤是针对Ubuntu系统的。如果你使用的是其他Linux发行版,请相应地调整命令。
110 1
|
4月前
|
Ubuntu
百度搜索:蓝易云【Ubuntu删除多余内核教程】
现在,你已经成功地删除了Ubuntu系统中多余的旧内核。请谨慎删除内核,确保保留当前正在使用的稳定内核以及至少一个备用内核,以防止出现意外问题。
105 2
|
4月前
|
Ubuntu 网络安全
百度搜索:蓝易云【ubuntu系统ufw开放端口教程】
现在,你已经成功在Ubuntu系统中使用ufw开放了指定的端口。请确保只开放必要的端口,并注意网络安全。
98 3

相关实验场景

更多