From 48f5dec9c49b3d54e0cceafa6a6e0f0241cb94aa Mon Sep 17 00:00:00 2001 From: lxk0301 <778732665@qq.com> Date: Thu, 3 Dec 2020 17:33:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=98=BE=E7=A4=BA=20?= =?UTF-8?q?=E6=94=B6=E5=8F=960=E7=94=B5=E5=8A=9B=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=EF=BC=8C=E5=A2=9E=E5=8A=A0=E5=88=A4=E6=96=AD=E5=A6=82?= =?UTF-8?q?=E9=81=87=E5=88=B0=E5=8F=8C=E5=80=8D=E7=94=B5=E5=8A=9B=E6=94=B6?= =?UTF-8?q?=E5=8F=96=E8=BE=BE=E5=88=B0=E4=B8=8A=E9=99=90=E5=90=8E=EF=BC=8C?= =?UTF-8?q?=E4=B8=8D=E5=86=8D=E7=AD=89=E9=9B=86=E6=BB=A1=E5=86=8D=E6=94=B6?= =?UTF-8?q?=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jd_dreamFactory.js | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/jd_dreamFactory.js b/jd_dreamFactory.js index 523c821d..3f78bf19 100644 --- a/jd_dreamFactory.js +++ b/jd_dreamFactory.js @@ -125,7 +125,7 @@ function collectElectricity(facId = $.factoryId, help = false, master) { message += `【帮助好友】帮助成功,获得 ${data.data['loginPinCollectElectricity']} 电力\n` } else { $.ele += Number(data.data['CollectElectricity']) - console.log(`收取 ${data.data['loginPinCollectElectricity']} 电力`); + console.log(`收取 ${data.data['CollectElectricity']} 电力`); message += `【收取发电站】收取成功,获得 ${data.data['CollectElectricity']} 电力\n` } } else { @@ -246,13 +246,21 @@ function getUserElectricity() { if (safeGet(data)) { data = JSON.parse(data); if (data['ret'] === 0) { - console.log(`发电机:当前 ${data.data.currentElectricityQuantity} 电力,最大值 ${data.data.maxElectricityQuantity} 电力,达到最大电量才会进行收取`) - if (data.data.currentElectricityQuantity === data.data.maxElectricityQuantity && data.data.doubleElectricityFlag) { - console.log(`发电机:电力可翻倍并收获`) - // await shareReport(); - await collectElectricity() + console.log(`\nnextCollectDoubleFlag::${data.data.nextCollectDoubleFlag}`); + console.log(`nextCollectDoubleType::${data.data.nextCollectDoubleType}\n`); + $.log(`下次集满收取${data.data.nextCollectDoubleFlag === 1 ? '可' : '不可'}双倍电力`) + console.log(`发电机:当前 ${data.data.currentElectricityQuantity} 电力,最大值 ${data.data.maxElectricityQuantity} 电力`) + if (data.data.nextCollectDoubleFlag === 1) { + if (data.data.currentElectricityQuantity === data.data.maxElectricityQuantity && data.data.doubleElectricityFlag) { + console.log(`发电机:电力可翻倍并收获`) + // await shareReport(); + await collectElectricity() + } else { + message += `【发电机电力】当前 ${data.data.currentElectricityQuantity} 电力,未达到收获标准\n` + } } else { - message += `【发电机电力】当前 ${data.data.currentElectricityQuantity} 电力,未达到收获标准\n` + //再收取双倍电力达到上限时,直接收取,不再等到满级 + await collectElectricity() } } }