mirror of
https://github.com/yml2213/javascript.git
synced 2026-10-18 06:17:43 +08:00
5-13 增加箱提示,增加分享任务
This commit is contained in:
+50
-11
@@ -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 `;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user