有概率被淘宝检测脚本,导致奖励变少,本人一概不负责
更新记录
10.30 一次运行5分钟,防止检测有效
使用流程
1.下载autojs,创建文件把脚本代码复制
2.打开淘宝,进入淘金币领体力界面

3.进入搜索任务,替换代码中的挡风披冬季,为任意你的物品即可,随后返回领体力界面

3.返回autojs,启动脚本,打开淘宝,此时在领体力任务界面
代码
js
"auto";
auto.waitFor();
var height = device.height;
var width = device.width;
setScreenMetrics(width, height);
toast("开始执行淘宝浏览类任务...");
app.launchApp("淘宝");
sleep(3000);
// ✅ 设置运行时间上限(毫秒)
var maxRunTime = 5 * 60 * 1000; // 5分钟
var startTime = new Date().getTime();
var maxTry = 1000;
var tryCount = 0;
while (tryCount < maxTry) {
// 检查运行时间
var now = new Date().getTime();
if (now - startTime > maxRunTime) {
toast("运行时间已到5分钟,自动停止");
exit();
}
tryCount++;
var buttons = text("去完成").find();
if (buttons.empty()) {
toast("未找到'去完成',尝试滑动刷新...");
swipe(width / 2, height * 0.8, width / 2, height * 0.3, 800);
sleep(3000);
continue;
}
var found = false;
for (var i = 0; i < buttons.size(); i++) {
var btn = buttons.get(i);
var parent = btn.parent();
var textAll = "";
if (parent) {
var textViews = parent.find(className("TextView"));
var minDist = 10000;
textViews.forEach(tv => {
var dist = Math.abs(tv.bounds().centerY() - btn.bounds().centerY());
if (dist < minDist) {
minDist = dist;
textAll = tv.text();
}
});
}
toast("检测到任务文本:" + textAll);
if (textAll && textAll.match(/浏览.*秒/)) {
found = true;
toast("执行任务:" + textAll);
// 从任务文本提取浏览时间(默认15秒)
var timeMatch = textAll.match(/(\d+)\s*秒/);
var browseSeconds = timeMatch ? parseInt(timeMatch[1]) : 15;
if (browseSeconds < 5) browseSeconds = 5; // 设置最小5秒
// 点击"去完成"
try {
if (btn.clickable()) {
btn.click();
} else {
click(btn.bounds().centerX(), btn.bounds().centerY());
}
} catch (e) {
toast("点击异常,尝试坐标点击");
click(btn.bounds().centerX(), btn.bounds().centerY());
}
sleep(2000); // 等待页面加载
// 检测是否有"搜索"按钮
var searchBtn = text("搜索").findOne(2000);
if (searchBtn) {
toast("发现搜索按钮,先点击挡风披冬季");
var itemBtn = text("挡风被冬季").findOne(2000);
if (itemBtn) {
itemBtn.click();
sleep(1000);
}
toast("点击搜索按钮");
searchBtn.click();
sleep(2000);
}
// 模拟滑动浏览页面(7次)
for (var j = 0; j < 7; j++) {
swipe(width / 2, height * 0.8, width / 2, height * 0.2, 800);
sleep(1500);
}
// 模拟浏览时间(动态调整)
var browseMs = browseSeconds * 1000;
toast("浏览约 " + browseSeconds + " 秒");
sleep(browseMs);
try {
back();
} catch (e) {
toast("返回失败,重试");
sleep(2000);
back();
}
sleep(4000);
break;
}
}
if (!found) {
toast("未找到浏览类任务,继续下滑刷新...");
swipe(width / 2, height * 0.8, width / 2, height * 0.3, 800);
sleep(3000);
}
}
toast("任务循环结束");