diff --git a/jd_jxnc.js b/jd_jxnc.js index 9df094fa..1befe111 100644 --- a/jd_jxnc.js +++ b/jd_jxnc.js @@ -90,6 +90,7 @@ let assistUserShareCode = 0; // 随机助力用户 share code subTitle = ''; message = ''; option = {}; + $.answer = 0; $.helpNum = 0; $.helpSelfNum = 0; await tokenFormat(); // 处理当前账号 token @@ -310,6 +311,11 @@ function browserTask() { break; } } + if (status[0] === 1017) { // ret:1017 retmsg:"score full" 水滴已满,果实成熟,跳过所有任务 + $.log('水滴已满,果实成熟,跳过所有任务'); + resolve(true); + break; + } if (status[0] === 1032) { $.log('任务执行失败,种植的 APP 专属种子,请提供 token 或种植非 APP 种子'); message += '任务执行失败,种植的 APP 专属种子,请提供 token 或种植非 APP 种子\n'; @@ -350,6 +356,10 @@ function answerTask() { if (ret === 0 && right === 1) { $.drip += eachtimeget; } + if (ret === 1017) { // ret:1017 retmsg:"score full" 水滴已满,果实成熟,跳过答题 + resolve(); + return; + } if (((ret !== 0 && ret !== 1029) || retmsg === 'ans err') && $.answer < 4) { $.answer++; await $.wait(1000); @@ -367,7 +377,7 @@ function answerTask() { function getMessage(endInfo, startInfo) { const need = endInfo.target - endInfo.score; - const get = endInfo.modifyscore; // 本地变更获得水滴 + const get = endInfo.modifyscore; // 本次变更获得水滴 const leaveGet = startInfo.modifyscore; // 离开时获得水滴 let dayGet = 0; // 今日共获取水滴数 if ($.detail) { @@ -379,6 +389,11 @@ function getMessage(endInfo, startInfo) { }); } message += `【水滴】本次获得${get} 离线获得${leaveGet} 今日获得${dayGet} 还需水滴${need}\n`; + if (need <= 0) { + notifyBool = true; + message += `【成熟】水果已成熟请及时收取\n`; + return; + } if (get > 0 || leaveGet > 0 || dayGet > 0) { const day = Math.ceil(need / (dayGet > 0 ? dayGet : (get + leaveGet))); message += `【预测】还需 ${day} 天\n`; @@ -401,6 +416,7 @@ function submitInviteId(userName) { $.post( { url: `https://api.ninesix.cc/api/jx-nc/${$.info.smp}/${encodeURIComponent(userName)}?active=${$.info.active}`, + timeout: 3000 }, (err, resp, _data) => { try { @@ -426,7 +442,7 @@ function submitInviteId(userName) { function getAssistUser() { return new Promise(resolve => { try { - $.get({url: `https://api.ninesix.cc/api/jx-nc?active=${$.info.active}`}, async (err, resp, _data) => { + $.get({url: `https://api.ninesix.cc/api/jx-nc?active=${$.info.active}`, timeout: 3000}, async (err, resp, _data) => { try { const {code, data = {}} = JSON.parse(_data); if (data.value) { @@ -547,6 +563,7 @@ function taskUrl(function_path, body) { Host: `wq.jd.com`, 'Accept-Language': `zh-cn`, }, + timeout: 3000, }; }