autojs教程:果果山app脚本代码

果果山app脚本代码
用autojs编写
~~
供参考而已

重点还是相同等级的宠物合成环节~~

//===============================================================
//果果山脚本
function 果果山脚本() {
    launchApp("果果山");
    console.log("打开果果山app");
    sleep(5000);

    //抽奖
    try {
        while (true) {

            if (id("rm").depth(8).findOnce() != null) {
                id("rm").depth(8).findOnce().click();
                console.log("看视频翻倍")
                sleep(6000);
                if (id("tt_video_ad_close_layout").findOnce()) {
                    sleep(random(1000, 2000));
                    id("tt_video_ad_close_layout").click();
                    console.log("关闭广告");
                    sleep(1000)
                } else {
                    if (className("android.widget.ImageView").depth(5).findOnce()) {
                        className("android.widget.ImageView").depth(5).findOnce().click();
                        sleep(1500)
                    }
                }
            }

            if (id("fi").findOnce() != null) {
                id("fi").findOnce().click();
                console.log("关闭提示")
                sleep(1000);
            }
            if (id("qf").findOnce() != null) {
                id("qf").findOnce().click();
                console.log("确定")
                sleep(1000);
            }


            if (id("tt_video_ad_close_layout").findOnce()) {
                id("tt_video_ad_close_layout").findOnce().click();
                console.log("关闭视频广告")
                sleep(random(800, 1000));
            } else {
                if (className("android.widget.ImageView").depth(5).findOnce()) {
                    className("android.widget.ImageView").depth(5).findOnce().click();
                    sleep(1500);
                }
            }
            if (id("g1").findOnce() != null) {
                console.log("开始抽奖")
                id("g1").findOnce().click();
                sleep(random(800, 1000));
            }

            if (text("抽奖券X0").findOnce() != null) {
                console.log("今日抽奖次数已用完");
                sleep(random(800, 1000));
                if (id("fi").findOnce() != null) {
                    id("fi").findOnce().click();
                    console.log("关闭提示")
                    sleep(1000);
                }
                break;
            } else if (id("com.sandfox.guoguoshan:id/as").findOnce()) {
                click(id("com.sandfox.guoguoshan:id/as").findOnce().bounds().centerX(), id("com.sandfox.guoguoshan:id/as").findOnce().bounds().centerY())
                sleep(random(500, 1000));
                textContains("恭喜获得").waitFor();
                sleep(random(500, 800));
                if (text("确定").findOnce()) {
                    text("确定").findOnce().click
  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值