From d5602316ef4c1c1efcfabac950b3c61bebc5a3cd Mon Sep 17 00:00:00 2001 From: KingRan Date: Sun, 3 Apr 2022 10:15:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jd_dpqd.js | 18 +++++++++++- jd_plantBean.js | 68 ++++++++++++++++++++++++++------------------ jd_plantBean_help.js | 44 ++++++++++++++++++++++++---- 3 files changed, 95 insertions(+), 35 deletions(-) diff --git a/jd_dpqd.js b/jd_dpqd.js index 74a4efa06..0c3af05d9 100644 --- a/jd_dpqd.js +++ b/jd_dpqd.js @@ -42,7 +42,23 @@ const token = [ "A16F88A9390FEEBE284BC13EC4BAC6E9", "E20BD5091D8F70B4649D529A09183F04", "48AF67C570FF4986535BF6559042E29D", - "B19EB262C4A4AD705862A6D6EFA8E474" + "B19EB262C4A4AD705862A6D6EFA8E474", + "88ECFB91288FD2DE93DDBDDAA9409D8E", + "1B2F8250713AD30F335B092B70A4DBF5", + "6B00C48608C4FAFA8D73FE58BC2B6099", + "ECB1A135E3760C78C2AB74B747A537FB", + "032C7983152472648378B72028B62C40", + "2593927DBC99178C9E835A607D67482C", + "C521378DAAEA4D57BE44C0D5212060F3", + "8E3E6081738C9C30446C20F347516649", + "FAB1E61380C630230CEDBD9DEB9B66C1", + "BAF9032D06CA9D81F746BA7F95E27966", + "A795246AE4063905815D7748001C0A58", + "57B5F1912B8A5F7C3913EEB0CFA9130B", + "BA61728677870801781CD5DA61719904", + "C5F5FF51E040B2415A435D5BFDA15348", + "664227400540BC20B0160DE112BE806C", + "B5BD9A190DD6AD49A6E3646CB2700863" ] if ($.isNode()) { diff --git a/jd_plantBean.js b/jd_plantBean.js index 053d8ffb7..8efe814e4 100644 --- a/jd_plantBean.js +++ b/jd_plantBean.js @@ -41,6 +41,7 @@ let roundList = []; let awardState = '';//上期活动的京豆是否收取 let randomCount = $.isNode() ? 20 : 5; let num; +let llerror=false; $.newShareCode = []; let NowHour = new Date().getHours(); let lnrun = 0; @@ -93,33 +94,8 @@ async function jdPlantBean() { try { console.log(`获取任务及基本信息`) await plantBeanIndex(); - if ($.plantBeanIndexResult.errorCode === 'PB101') { - console.log(`\n活动太火爆了,还是去买买买吧!\n`) - return - } - if ($.plantBeanIndexResult.errorCode) { - console.log(`获取任务及基本信息出错,10秒后重试\n`) - await $.wait(10000); - await plantBeanIndex(); - if ($.plantBeanIndexResult.errorCode === 'PB101') { - console.log(`\n活动太火爆了,还是去买买买吧!\n`) - return - } - } - if ($.plantBeanIndexResult.errorCode) { - console.log(`获取任务及基本信息出错,30秒后重试\n`) - await $.wait(30000); - await plantBeanIndex(); - if ($.plantBeanIndexResult.errorCode === 'PB101') { - console.log(`\n活动太火爆了,还是去买买买吧!\n`) - return - } - } - if ($.plantBeanIndexResult.errorCode) { - console.log(`获取任务及基本信息失败,活动异常,换个时间再试试吧....`) - console.log("错误代码;"+$.plantBeanIndexResult.errorCode) - return - } + if(llerror) + return; for (let i = 0; i < $.plantBeanIndexResult.data.roundList.length; i++) { if ($.plantBeanIndexResult.data.roundList[i].roundState === "2") { num = i @@ -199,6 +175,8 @@ async function doGetReward() { } async function doCultureBean() { await plantBeanIndex(); + if(llerror) + return; if ($.plantBeanIndexResult && $.plantBeanIndexResult.code === '0') { const plantBeanRound = $.plantBeanIndexResult.data.roundList[num] if (plantBeanRound.roundState === '2') { @@ -429,6 +407,8 @@ async function doTask() { function showTaskProcess() { return new Promise(async resolve => { await plantBeanIndex(); + if(llerror) + return; $.taskList = $.plantBeanIndexResult.data.taskList; if ($.taskList && $.taskList.length > 0) { console.log(" 任务 进度"); @@ -548,7 +528,39 @@ async function helpShare(plantUuid) { console.log(`助力结果的code:${$.helpResult && $.helpResult.code}`); } async function plantBeanIndex() { - $.plantBeanIndexResult = await request('plantBeanIndex');//plantBeanIndexBody + llerror=false; + $.plantBeanIndexResult = await request('plantBeanIndex'); //plantBeanIndexBody + if ($.plantBeanIndexResult.errorCode === 'PB101') { + console.log(`\n活动太火爆了,还是去买买买吧!\n`) + llerror=true; + return + } + if ($.plantBeanIndexResult.errorCode) { + console.log(`获取任务及基本信息出错,10秒后重试\n`) + await $.wait(10000); + $.plantBeanIndexResult = await request('plantBeanIndex'); + if ($.plantBeanIndexResult.errorCode === 'PB101') { + console.log(`\n活动太火爆了,还是去买买买吧!\n`) + llerror=true; + return + } + } + if ($.plantBeanIndexResult.errorCode) { + console.log(`获取任务及基本信息出错,30秒后重试\n`) + await $.wait(30000); + $.plantBeanIndexResult = await request('plantBeanIndex'); + if ($.plantBeanIndexResult.errorCode === 'PB101') { + console.log(`\n活动太火爆了,还是去买买买吧!\n`) + llerror=true; + return + } + } + if ($.plantBeanIndexResult.errorCode) { + console.log(`获取任务及基本信息失败,活动异常,换个时间再试试吧....`) + console.log("错误代码;" + $.plantBeanIndexResult.errorCode) + llerror=true; + return + } } function requireConfig() { return new Promise(resolve => { diff --git a/jd_plantBean_help.js b/jd_plantBean_help.js index 9744ed69d..d5e6c16a7 100644 --- a/jd_plantBean_help.js +++ b/jd_plantBean_help.js @@ -42,6 +42,7 @@ let awardState = '';//上期活动的京豆是否收取 let randomCount = $.isNode() ? 20 : 5; let num; $.newShareCode = []; +let llerror=false; let lnrun = 0; let lnruns = 0; !(async () => { @@ -94,11 +95,10 @@ let lnruns = 0; async function jdPlantBean() { try { - await plantBeanIndex(); - if ($.plantBeanIndexResult.errorCode === 'PB101') { - console.log(`\n活动太火爆了,还是去买买买吧!\n`) - return - } + console.log(`获取任务及基本信息`) + await plantBeanIndex(); + if(llerror) + return; for (let i = 0; i < $.plantBeanIndexResult.data.roundList.length; i++) { if ($.plantBeanIndexResult.data.roundList[i].roundState === "2") { num = i @@ -280,7 +280,39 @@ async function helpShare(plantUuid) { //console.log(`助力结果的code:${$.helpResult && $.helpResult.code}`); } async function plantBeanIndex() { - $.plantBeanIndexResult = await request('plantBeanIndex');//plantBeanIndexBody + llerror=false; + $.plantBeanIndexResult = await request('plantBeanIndex'); //plantBeanIndexBody + if ($.plantBeanIndexResult.errorCode === 'PB101') { + console.log(`\n活动太火爆了,还是去买买买吧!\n`) + llerror=true; + return + } + if ($.plantBeanIndexResult.errorCode) { + console.log(`获取任务及基本信息出错,10秒后重试\n`) + await $.wait(10000); + $.plantBeanIndexResult = await request('plantBeanIndex'); + if ($.plantBeanIndexResult.errorCode === 'PB101') { + console.log(`\n活动太火爆了,还是去买买买吧!\n`) + llerror=true; + return + } + } + if ($.plantBeanIndexResult.errorCode) { + console.log(`获取任务及基本信息出错,30秒后重试\n`) + await $.wait(30000); + $.plantBeanIndexResult = await request('plantBeanIndex'); + if ($.plantBeanIndexResult.errorCode === 'PB101') { + console.log(`\n活动太火爆了,还是去买买买吧!\n`) + llerror=true; + return + } + } + if ($.plantBeanIndexResult.errorCode) { + console.log(`获取任务及基本信息失败,活动异常,换个时间再试试吧....`) + console.log("错误代码;" + $.plantBeanIndexResult.errorCode) + llerror=true; + return + } } function requestGet(function_id, body = {}) { if (!body.version) {