修复bug
This commit is contained in:
parent
c34cabfc9b
commit
0d671ee032
@ -11,11 +11,11 @@ function start() {
|
|||||||
sleep(3000);
|
sleep(3000);
|
||||||
while (textContains("运动+").exists()) {
|
while (textContains("运动+").exists()) {
|
||||||
textContains("运动+").findOnce().click();
|
textContains("运动+").findOnce().click();
|
||||||
toast("收集运动卡币");sleep(3000);
|
toast("收集运动卡币"); sleep(3000);
|
||||||
}
|
}
|
||||||
while (textContains("任务+").exists()) {
|
while (textContains("任务+").exists()) {
|
||||||
textContains("任务+").findOnce().click();
|
textContains("任务+").findOnce().click();
|
||||||
toast("收集任务卡币");sleep(3000);
|
toast("收集任务卡币"); sleep(3000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
doTask();
|
doTask();
|
||||||
@ -36,13 +36,13 @@ function doTask() {
|
|||||||
sleep(3000);
|
sleep(3000);
|
||||||
for (var i = 0; i < 5; i++) {
|
for (var i = 0; i < 5; i++) {
|
||||||
className("android.view.View").scrollable(true).depth(15).findOne().child(i).child(0).child(4).click();
|
className("android.view.View").scrollable(true).depth(15).findOne().child(i).child(0).child(4).click();
|
||||||
toast("加购第" + (i+1) + "个商品");
|
toast("加购第" + (i + 1) + "个商品");
|
||||||
sleep(5000);
|
sleep(5000);
|
||||||
back();
|
back();
|
||||||
sleep(3000);
|
sleep(3000);
|
||||||
}
|
}
|
||||||
toast("浏览加购完成,返回");
|
toast("浏览加购完成,返回");
|
||||||
} else if (textContains("浏览").exists() && textContains("浏览").findOnce().parent().child(8).text() == "去完成") {
|
} else if (textContains("浏览").exists() && textContains("浏览").findOnce().parent().child(8).text() == "去完成") {
|
||||||
textContains("浏览").findOnce().parent().child(8).click();
|
textContains("浏览").findOnce().parent().child(8).click();
|
||||||
sleep(3000);
|
sleep(3000);
|
||||||
toast("浏览完成,返回");
|
toast("浏览完成,返回");
|
||||||
@ -50,10 +50,10 @@ function doTask() {
|
|||||||
textStartsWith("参与可得").findOnce().parent().child(8).click();
|
textStartsWith("参与可得").findOnce().parent().child(8).click();
|
||||||
sleep(3000);
|
sleep(3000);
|
||||||
toast("浏览完成,返回");
|
toast("浏览完成,返回");
|
||||||
}else if (textContains("成功入会").exists() && textContains("成功入会").findOnce().parent().child(8).text() == "去完成") {
|
} else if (textContains("成功入会").exists() && textContains("成功入会").findOnce().parent().child(8).text() == "去完成") {
|
||||||
textContains("成功入会").findOnce().parent().child(8).click();
|
textContains("成功入会").findOnce().parent().child(8).click();
|
||||||
sleep(3000);
|
sleep(3000);
|
||||||
if(textContains("加入店铺会员").exists()){
|
if (textContains("加入店铺会员").exists()) {
|
||||||
toast("脚本结束(涉及个人隐私,请手动加入店铺会员或者忽略加入会员任务)");
|
toast("脚本结束(涉及个人隐私,请手动加入店铺会员或者忽略加入会员任务)");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -66,16 +66,15 @@ function doTask() {
|
|||||||
sleep(1000);//给提示一个显示的时间
|
sleep(1000);//给提示一个显示的时间
|
||||||
back();
|
back();
|
||||||
sleep(3000);
|
sleep(3000);
|
||||||
for(var i=0;!className("android.widget.Image").text("c143642ad0850f7a").exists()&&i<5;i++){
|
for (var i = 1; !className("android.widget.Image").text("c143642ad0850f7a").exists() && i <= 5; i++) {
|
||||||
toast("返回");
|
if (i == 5) {
|
||||||
|
toast("无法返回任务界面,脚本结束");
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
toast("无法返回任务界面,第" + i + "次尝试返回(最多4次)");
|
||||||
sleep(1000);
|
sleep(1000);
|
||||||
back();
|
back();
|
||||||
sleep(3000);
|
sleep(3000);
|
||||||
if(i==5){
|
|
||||||
toast("无法返回任务界面,请重新执行脚本");
|
|
||||||
exit();
|
|
||||||
}
|
|
||||||
}//避免弹窗,返回任务界面
|
}//避免弹窗,返回任务界面
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user