Autojs使用

1、抖音

auto();
var appName=rawInput("","抖音极速版");
launchApp("抖音极速版");
sleep("8000");
setScreenMetrics(1080,1920);
sleep("3000")
var num=3;
while(num>1){       
    sleep(1000);
    swipe(device.width/2,1300,device.width/2,300,2000);
    sleep(5000);
}

2、七猫

auto.waitFor();
let see_count=180;//rawInput('请输入滑动次数', '180');;
app.launchApp('七猫免费小说');
sleep(10000);
console.show(); //开启日志(悬浮窗权限)
let bookList = className("android.widget.LinearLayout").find();
if (bookList != null) {
    bookList[2].click();
}
sleep(5000);
for (var i = 1; i <= see_count; i++) {
    toast("七猫免费小说滑动" + i + "次" + "总计:" + see_count + "次");
    console.log("七猫免费小说滑动" + i + "次" + "总计:" + see_count + "次");
    swipe(750, 120, 100, 120, 100);
    let delayTime = random(15000, 20000);
    sleep(delayTime);
}

3、番茄

auto.waitFor();
let see_count=180;//rawInput('请输入滑动次数', '180');;
app.launchApp('番茄免费小说');
sleep(10000);
console.show(); //开启日志(悬浮窗权限)
console.setSize(device.width , device.height / 4);
try {
    if (className("android.widget.RadioButton").id('in').exists()) {
        let bookshelf = className("android.widget.RadioButton").id('in').findOnce();
        bookshelf.click();
        sleep(2000);
        let booklist = className('android.view.ViewGroup').find();//查找到的所有ViewGroup
        if (booklist != null) {
            booklist[1].click();//第一本书的ViewGroup
        }
    }
} catch (e) { }
sleep(10000);
for (var i = 0; i < see_count; i++) {
    toast("番茄免费小说滑动" + i + "次" + "总计:" + see_count + "次");
    console.log("番茄免费小说滑动" + i + "次" + "总计:" + see_count + "次");
    pressTime = random(250, 600);
    swipe(750, 1000, 100, 1000, pressTime);
    delayTime = random(15000, 20000);
    sleep(delayTime);
}
home();

你可能感兴趣的:(Autojs使用)