双十二淘宝自动浏览autojs脚本源码
今天淘宝更新了双12的活动双十一时候用的脚本「去逛店」 「去浏览」 按钮获取不到了
改成了通过textContain「浏览」获取,并用正则表达式判断任务是否完成还是否需要重复浏览
在能量中心开始运行,运行完毕需要自行停止脚本
第一次发自己写的东西,大家给加加分吧_(:3 」∠)_
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(10000);
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(10000);
swipe(width / 2, height - 500, width / 2, 0, 500);
sleep(8000);
back();
sleep(1500);
}
})
}
toast("请在能量中心开始运行,需要自行开始和停止脚本");
6666666666 好的,非常感谢 谢谢大佬 谢谢分享
页:
[1]