var height = device.height;
var width = device.width;
if (text("签到").exists()) {
text("签到").findOne().click();
sleep(1600);
toast("签到成功")
}
sleep(1500);
while (textContains("去浏览").exists()) {
toast("存在去浏览");
textContains("去浏览").find().forEach(function(o) {
text_str = o.text()
text_str = text_str.match(/\d+\/\d+/g).join()
click_cnt = parseInt(text_str.match(/\d+/g));
goal_cnt = parseInt(text_str.match(/\/\d+/g).join().replace("/", ""));
log(click_cnt, goal_cnt)
if (click_cnt != goal_cnt) {
toast("找到了");
o.click();
sleep(1500);
swipe(width / 2, height - 500, width / 2, 0, 500);
sleep(2500);
swipe(width / 2, height - 500, width / 2, 0, 500);
sleep(15000);
swipe(width / 2, height - 500, width / 2, 0, 500);
sleep(8000);
back();
sleep(1500);
}
})
}
while (textContains("去搜索").exists()) {
toast("存在去搜索");
textContains("去搜索").find().forEach(function(o) {
text_str = o.text()
text_str = text_str.match(/\d+\/\d+/g).join()
click_cnt = parseInt(text_str.match(/\d+/g));
goal_cnt = parseInt(text_str.match(/\/\d+/g).join().replace("/", ""));
log(click_cnt, goal_cnt)
if (click_cnt != goal_cnt) {
toast("找到了");
o.click();
sleep(1500);
swipe(width / 2, height - 500, width / 2, 0, 500);
sleep(2500);
swipe(width / 2, height - 500, width / 2, 0, 500);
sleep(15000);
swipe(width / 2, height - 500, width / 2, 0, 500);
sleep(8000);
back();
sleep(1500);
}
})
}
toast("请在能量中心开始运行,需要自行开始和停止脚本");
var width = device.width;
if (text("签到").exists()) {
text("签到").findOne().click();
sleep(1600);
toast("签到成功")
}
sleep(1500);
while (textContains("去浏览").exists()) {
toast("存在去浏览");
textContains("去浏览").find().forEach(function(o) {
text_str = o.text()
text_str = text_str.match(/\d+\/\d+/g).join()
click_cnt = parseInt(text_str.match(/\d+/g));
goal_cnt = parseInt(text_str.match(/\/\d+/g).join().replace("/", ""));
log(click_cnt, goal_cnt)
if (click_cnt != goal_cnt) {
toast("找到了");
o.click();
sleep(1500);
swipe(width / 2, height - 500, width / 2, 0, 500);
sleep(2500);
swipe(width / 2, height - 500, width / 2, 0, 500);
sleep(15000);
swipe(width / 2, height - 500, width / 2, 0, 500);
sleep(8000);
back();
sleep(1500);
}
})
}
while (textContains("去搜索").exists()) {
toast("存在去搜索");
textContains("去搜索").find().forEach(function(o) {
text_str = o.text()
text_str = text_str.match(/\d+\/\d+/g).join()
click_cnt = parseInt(text_str.match(/\d+/g));
goal_cnt = parseInt(text_str.match(/\/\d+/g).join().replace("/", ""));
log(click_cnt, goal_cnt)
if (click_cnt != goal_cnt) {
toast("找到了");
o.click();
sleep(1500);
swipe(width / 2, height - 500, width / 2, 0, 500);
sleep(2500);
swipe(width / 2, height - 500, width / 2, 0, 500);
sleep(15000);
swipe(width / 2, height - 500, width / 2, 0, 500);
sleep(8000);
back();
sleep(1500);
}
})
}
toast("请在能量中心开始运行,需要自行开始和停止脚本");