From f15392c79a22f989b0d81015552ecd1b51590ff9 Mon Sep 17 00:00:00 2001 From: lxk0301 <778732665@qq.com> Date: Fri, 1 Jan 2021 18:10:12 +0800 Subject: [PATCH] =?UTF-8?q?jd=5Fcrazy=5Fjoy=5Fcoin.js=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E8=B4=AD=E4=B9=B0=E7=AD=89=E7=BA=A7?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=EF=BC=8C=E7=8E=AF=E5=A2=83=E5=8F=98=E9=87=8F?= =?UTF-8?q?=E4=B8=BA=20BUY=5FJPY=5FLEVEL=EF=BC=8C=E5=A6=82=E6=9E=9C?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E7=9A=84=E8=B4=AD=E4=B9=B0=E7=AD=89=E7=BA=A7?= =?UTF-8?q?=E5=A4=A7=E4=BA=8E=E6=9C=80=E9=AB=98=E5=8F=AF=E8=B4=AD=E4=B9=B0?= =?UTF-8?q?=E7=AD=89=E7=BA=A7=EF=BC=8C=E5=88=99=E8=AE=BE=E7=BD=AE=E5=A4=B1?= =?UTF-8?q?=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jd_crazy_joy_coin.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/jd_crazy_joy_coin.js b/jd_crazy_joy_coin.js index 4e4a5a3b..8bf51c43 100644 --- a/jd_crazy_joy_coin.js +++ b/jd_crazy_joy_coin.js @@ -204,6 +204,10 @@ async function jdJxStory() { await $.wait(1000) await getJoyShop() await $.wait(1000) + $.log('当前JOY分布情况') + $.log(`\n${$.joyIds[0]} ${$.joyIds[1]} ${$.joyIds[2]} ${$.joyIds[3]}`) + $.log(`${$.joyIds[4]} ${$.joyIds[5]} ${$.joyIds[6]} ${$.joyIds[7]}`) + $.log(`${$.joyIds[8]} ${$.joyIds[9]} ${$.joyIds[10]} ${$.joyIds[11]}\n`) for (let i = 0; i < $.joyIds.length; ++i) { if (!$.canBuy) { $.log(`金币不足,跳过购买`) @@ -280,8 +284,14 @@ function getJoyShop() { data = JSON.parse(data); if (data.success && data.data && data.data.shop) { const shop = data.data.shop.filter(vo => vo.status === 1) || [] - $.buyJoyLevel = shop.length ? shop[shop.length - 1]['joyId'] : 1 - $.cost = shop.length ? shop[shop.length - 1]['coins'] : Infinity + $.buyJoyLevel = shop.length ? shop[shop.length - 1]['joyId'] : 1;//可购买的最大等级 + if ($.isNode() && process.env.BUY_JPY_LEVEL) { + $.log(`当前可购买的最高JOY等级为${$.buyJoyLevel}级\n`) + $.buyJoyLevel = (process.env.BUY_JPY_LEVEL * 1) > $.buyJoyLevel ? $.buyJoyLevel : process.env.BUY_JPY_LEVEL * 1; + $.cost = shop[$.buyJoyLevel - 1]['coins'] + } else { + $.cost = shop.length ? shop[shop.length - 1]['coins'] : Infinity + } } } } catch (e) {