From 189caa8d028ade8a004643ffa1c25d1e36b9161b Mon Sep 17 00:00:00 2001 From: yml2213 Date: Fri, 13 May 2022 14:35:48 +0800 Subject: [PATCH] =?UTF-8?q?5-13=09=E5=A2=9E=E5=8A=A0=E7=AE=B1=E6=8F=90?= =?UTF-8?q?=E7=A4=BA,=E5=A2=9E=E5=8A=A0=E5=88=86=E4=BA=AB=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ksjsb/ksjsb.js | 61 +++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 50 insertions(+), 11 deletions(-) diff --git a/ksjsb/ksjsb.js b/ksjsb/ksjsb.js index df86c80..71a1ada 100644 --- a/ksjsb/ksjsb.js +++ b/ksjsb/ksjsb.js @@ -6,7 +6,8 @@ * * cron 0-59/30 6-20 * * * yml2213_javascript_master/ksjsb.js * - * 5-13 完成签到,开宝箱功能 --脚本开源,欢迎 pr + * 5-13 完成签到,宝箱信息功能 --脚本开源,欢迎 pr + * 5-13 增加箱提示,增加分享任务 * * * 感谢所有测试人员 @@ -26,7 +27,7 @@ let ck = ""; let usre_name; /////////////////////////////////////////////////////////////////// -let Version = '\n yml 2022/5/11 完成签到,开宝箱功能,请使用完整版ck\n' +let Version = '\n yml 2022/5/13-2 完成签到,宝箱,分享 功能,请使用完整版ck\n' let thank = `\n 感谢 xx 的投稿\n` let test = `\n 脚本测试中,有bug及时反馈! 脚本测试中,有bug及时反馈!\n` /////////////////////////////////////////////////////////////////// @@ -88,6 +89,14 @@ async function start() { await $.wait(2 * 1000); + if (local_hours() == 14) { + console.log("开始 分享"); + await Share(); + await $.wait(2 * 1000); + } + local_hours() + + @@ -207,12 +216,15 @@ async function box_info() { let result = await httpGet(url, `宝箱信息`); if (result.result == 1) { - if (result.data.openTime != 0) { + if (result.data.openTime == -1) { + console.log(`\n 宝箱信息: 今天的宝箱开完了,明天再来吧! \n`); + msg += `\n 宝箱信息: 今天的宝箱开完了,明天再来吧! \n`; + } else if (result.data.openTime != 0) { console.log(`\n 宝箱信息: 宝箱冷却中, ${result.data.openTime / 1000 / 60} 分钟 后重试吧! \n`); msg += `\n 宝箱信息: 宝箱冷却中, ${result.data.openTime / 1000 / 60} 分钟 后重试吧! \n`; } else { - console.log(`\n 宝箱信息: ${usre_name} 可以宝箱信息,去 开宝箱 喽! \n`); - msg += `\n 宝箱信息: ${usre_name} 可以宝箱信息,去 开宝箱 喽! \n`; + console.log(`\n 宝箱信息: ${usre_name} 可以宝箱信息,去 宝箱信息 喽! \n`); + msg += `\n 宝箱信息: ${usre_name} 可以宝箱信息,去 宝箱信息 喽! \n`; await $.wait(3 * 1000); await open_box(); } @@ -231,7 +243,7 @@ async function box_info() { /** - * 开宝箱 httpGet + * 宝箱信息 httpGet * https://nebula.kuaishou.com/rest/n/nebula/box/explore?isOpen=true&isReadyOfAdPlay=true */ async function open_box() { @@ -241,15 +253,42 @@ async function open_box() { 'Cookie': ck[0], }, }; - let result = await httpGet(url, `开宝箱`); + let result = await httpGet(url, `宝箱信息`); if (result.result == 1) { - console.log(`\n 开宝箱: 获得 金币 ${result.data.commonAwardPopup.awardAmount} 枚!\n`); - msg += `\n 开宝箱: 获得 金币 ${result.data.commonAwardPopup.awardAmount} 枚!\n`; + console.log(`\n 宝箱信息: 获得 金币 ${result.data.commonAwardPopup.awardAmount} 枚!\n`); + msg += `\n 宝箱信息: 获得 金币 ${result.data.commonAwardPopup.awardAmount} 枚!\n`; } else { - console.log(`\n 开宝箱: 失败 ❌ 了呢,原因未知! ${result} \n`); - msg += `\n 开宝箱: 失败 ❌ 了呢,原因未知! ${JSON.parse(result)} \n `; + console.log(`\n 宝箱信息: 失败 ❌ 了呢,原因未知! ${result} \n`); + msg += `\n 宝箱信息: 失败 ❌ 了呢,原因未知! ${JSON.parse(result)} \n `; + } +} + + + + +/** + * 分享获得 3000金币 httpGet + */ +async function Share() { + let url = { + url: `https://nebula.kuaishou.com/rest/n/nebula/daily/report?taskId=122`, + headers: { + 'Cookie': ck[0], + }, + }; + let result = await httpGet(url, `分享`); + + if (result.result == 1) { + console.log(`\n 分享: 获得 金币 ${result.data.amount} 枚!\n`); + msg += `\n 分享: 获得 金币 ${result.data.amount} 枚!\n`; + } else if (result.result == 14004) { + console.log(`\n 分享: 今天已经分享过了,明天再来吧!\n`); + msg += `\n 分享: 今天已经分享过了,明天再来吧!\n\n`; + } else { + console.log(`\n 分享: 失败 ❌ 了呢,原因未知! ${result} \n`); + msg += `\n 分享: 失败 ❌ 了呢,原因未知! ${JSON.parse(result)} \n `; } }