刘小帅

某视app自动私信脚本
launchApp("微视"); sleep(6000) // 点击头像进入资料界面 if ...
扫描右侧二维码阅读全文
11
2020/02

某视app自动私信脚本

launchApp("微视");
sleep(6000)

// 点击头像进入资料界面
if (className("android.view.View").exists()){

    var a=className("android.view.View").depth(6).find();
    var d = a.length;
    var b=a[1]
    log(d)
    var c = b.bounds();
    click(c.centerX(),c.centerY());
    sleep(1500)
}else{

    sleep(10000)
    var a=className("android.view.View").depth(6).find();
    var d = a.length;
    var b=a[1]
    log(d)
    var c = b.bounds();
    click(c.centerX(),c.centerY());
    sleep(1500)
}

// 点击进入粉丝界面
if (className("android.widget.TextView").exists()){

    var a1 = className("android.widget.TextView").depth(2).find();
    var b1 = a1[3]
    var c1 = b1.bounds();
    var d1 = a1.length;
    click(c1.centerX(),c1.centerY());
    sleep(2000)
}else{

    sleep(6000)
    var a1 = className("android.widget.TextView").depth(2).find();
    var b1 = a1[3]
    var c1 = b1.bounds();
    var d1 = a1.length;
    click(c1.centerX(),c1.centerY());
    sleep(2000)
}
    var a2=id("container").find();
    var b2 = a2.length-1;
    var number1 = 0

while (true){

    for (number=0;number<b2;number++){

        if (className("android.widget.TextView").exists()==false){

            var a1 = className("android.widget.TextView").depth(2).find();
            var b1 = a1[3]
            var c1 = b1.bounds();
            var d1 = a1.length;
            click(c1.centerX(),c1.centerY());
            sleep(2000)
        }
        if (a2){

            var c2 = a2[number]
            var d2 = c2.bounds();
            click(d2.centerX(),d2.centerY());
            sleep(1000)    
        }else{
            
            continue;
        }

        if(className("android.widget.TextView").exists()){
            //点击私信
            var a3 = className("android.widget.TextView").depth(1).find();
            var b3 = a3[7]
            var c3 = b3.bounds();
            click(c3.centerX(),c3.centerY());
            sleep(1500)
        }else{

            back();
            sleep(1000)
            continue;
        }
        //点击内容框
        if( id("text_input").exists()){
            if(id("right_content").exists()){

                back();
                sleep(1000)
                back();
                sleep(1000)
                back();
                sleep(1000)    
            }else{
                
                id("text_input").findOne().click();
                sleep(1000)
                setText("内容")
                id("btn_emotion").findOne().click();
                sleep(1000)
                id("btn_send_msg").findOne().click();
                sleep(1000)
                number1++;
                log("发送了"+number1+"次");
                sleep(1000)
                back();
                sleep(1000)
                back();
                sleep(1000)
                back();
                sleep(1000)

            }
            
        }else{
            back();
            sleep(1000)
            continue
        }
    }
    className ("android.support.v7.widget.RecyclerView").scrollForward()
    sleep(2000)
    var i = device.height/1.2 //获取设备高度
    var u = device.height/4
    swipe(500,i,500,u,400)
    sleep(2000)
    className ("android.support.v7.widget.RecyclerView").scrollForward()
    sleep(2000)
}   
Last modification:February 11th, 2020 at 03:32 pm
If you think my article is useful to you, please feel free to appreciate

Leave a Comment