From c34cabfc9b6a364769cf4ada57b69eb0d7bae587 Mon Sep 17 00:00:00 2001 From: loong Date: Thu, 15 Jul 2021 18:31:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B5=8F=E8=A7=88=E5=B0=8F?= =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E5=92=8C=E5=87=BA=E7=8E=B0=E5=BC=B9=E7=AA=97?= =?UTF-8?q?=E6=97=B6,=E6=97=A0=E6=B3=95=E8=BF=94=E5=9B=9E=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E7=95=8C=E9=9D=A2,=E4=BB=A5=E5=8F=8A=E4=B8=80?= =?UTF-8?q?=E4=BA=9B=E6=98=BE=E7=A4=BAbug.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- RanDongXiaJi.js | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/RanDongXiaJi.js b/RanDongXiaJi.js index acb966b..fa1aaf0 100644 --- a/RanDongXiaJi.js +++ b/RanDongXiaJi.js @@ -11,16 +11,15 @@ function start() { sleep(3000); while (textContains("运动+").exists()) { textContains("运动+").findOnce().click(); - toast("收集运动卡币");sleep(1000); + toast("收集运动卡币");sleep(3000); } while (textContains("任务+").exists()) { textContains("任务+").findOnce().click(); - toast("收集任务卡币");sleep(1000); + toast("收集任务卡币");sleep(3000); } } doTask(); } -//TODO:浏览小程序 function doTask() { className("android.widget.Image").text("c143642ad0850f7a").findOne().parent().click() toast("打开任务界面"); @@ -37,8 +36,8 @@ function doTask() { sleep(3000); for (var i = 0; i < 5; i++) { className("android.view.View").scrollable(true).depth(15).findOne().child(i).child(0).child(4).click(); - toast("加购第" + i + "个商品"); - sleep(3000); + toast("加购第" + (i+1) + "个商品"); + sleep(5000); back(); sleep(3000); } @@ -67,6 +66,16 @@ function doTask() { sleep(1000);//给提示一个显示的时间 back(); sleep(3000); + for(var i=0;!className("android.widget.Image").text("c143642ad0850f7a").exists()&&i<5;i++){ + toast("返回"); + sleep(1000); + back(); + sleep(3000); + if(i==5){ + toast("无法返回任务界面,请重新执行脚本"); + exit(); + } + }//避免弹窗,返回任务界面 } } \ No newline at end of file