Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
fangpidedongsun committed Feb 1, 2021
1 parent d608d36 commit 3ddb1da
Show file tree
Hide file tree
Showing 4 changed files with 208 additions and 46 deletions.
2 changes: 1 addition & 1 deletion jd_cash.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ let cookiesArr = [], cookie = '', message;
let helpAuthor = true;
const randomCount = $.isNode() ? 20 : 5;
const inviteCodes = [
`-4msulYas0O2JsRhE-2TA5XZmBQ@eU9Yar_mb_9z92_WmXNG0w@eU9YaO7jMvwh-W_VzyUX0Q@eU9YaurkY69zoj3UniVAgg@eU9YaOnjYK4j-GvWmXIWhA`,
`YFjh6Vll-l3zb9cCf_U@aURoM7PtY_Q@eU9YL5XqGLxSmRSAkwxR@eU9YaO7jMvwh-W_VzyUX0Q@eU9YaurkY69zoj3UniVAgg@eU9YaOnjYK4j-GvWmXIWhA`,
`-4msulYas0O2JsRhE-2TA5XZmBQ@eU9Yar_mb_9z92_WmXNG0w@eU9YaO7jMvwh-W_VzyUX0Q@eU9YaurkY69zoj3UniVAgg@eU9YaOnjYK4j-GvWmXIWhA`
]
if ($.isNode()) {
Expand Down
60 changes: 53 additions & 7 deletions jd_crazy_joy.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@ crazyJoy任务
每天运行一次即可
活动入口:京东APP我的-更多工具-疯狂的JOY
已支持IOS双京东账号,Node.js支持N个京东账号
脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js
============Quantumultx===============
[task_local]
#crazyJoy任务
10 7 * * * https://raw.githubusercontent.com/LXK9301/jd_scripts/master/jd_crazy_joy.js, tag=crazyJoy任务, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jd_crazy_joy.png, enabled=true
10 7 * * * https://gitee.com/lxk0301/jd_scripts/raw/master/jd_crazy_joy.js, tag=crazyJoy任务, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jd_crazy_joy.png, enabled=true
================Loon==============
[Script]
cron "10 7 * * *" script-path=https://raw.githubusercontent.com/LXK9301/jd_scripts/master/jd_crazy_joy.js,tag=crazyJoy任务
cron "10 7 * * *" script-path=https://gitee.com/lxk0301/jd_scripts/raw/master/jd_crazy_joy.js,tag=crazyJoy任务
===============Surge=================
crazyJoy任务 = type=cron,cronexp="10 7 * * *",wake-system=1,timeout=3600,script-path=https://raw.githubusercontent.com/LXK9301/jd_scripts/master/jd_crazy_joy.js
crazyJoy任务 = type=cron,cronexp="10 7 * * *",wake-system=1,timeout=3600,script-path=https://gitee.com/lxk0301/jd_scripts/raw/master/jd_crazy_joy.js
============小火箭=========
crazyJoy任务 = type=cron,script-path=https://raw.githubusercontent.com/LXK9301/jd_scripts/master/jd_crazy_joy.js, cronexpr="10 7 * * *", timeout=3600, enable=true
crazyJoy任务 = type=cron,script-path=https://gitee.com/lxk0301/jd_scripts/raw/master/jd_crazy_joy.js, cronexpr="10 7 * * *", timeout=3600, enable=true
*/

Expand Down Expand Up @@ -274,6 +274,7 @@ async function jdCrazyJoy() {
console.log(`检测您打开了自动兑换开关,去兑换京豆`)
await doApplyJdBean(applyJdBean)
}
await getSpecialJoy();
await showMsg();
}
async function doTasks() {
Expand Down Expand Up @@ -607,6 +608,52 @@ function getGrowthReward() {
})
})
}
//获取特殊JOY情况
function getSpecialJoy() {
return new Promise(async resolve => {
const body = { "paramData":{"typeId": 4} };
$.get(taskUrl('crazyJoy_user_getSpecialJoy', JSON.stringify(body)), async (err, resp, data) => {
try {
if (err) {
console.log(`${JSON.stringify(err)}`)
console.log(`${$.name} API请求失败,请检查网路重试`)
} else {
if (safeGet(data)) {
data = JSON.parse(data);
if (data['resultCode'] === '0') {
if (data.data) {
message += '五福汪情况:'
for (let item of data['data']) {
if (item['joyId'] === 1003) {
message += `多多JOY(${item['count']}只) `
} else if (item['joyId'] === 1004) {
message += `快乐JOY(${item['count']}只) `
} else if (item['joyId'] === 1005) {
message += `好物JOY(${item['count']}只) `
} else if (item['joyId'] === 1006) {
message += `省钱JOY(${item['count']}只) `
} else if (item['joyId'] === 1007) {
message += `东东JOY(${item['count']}只)`
} else {
message += `暂无`
}
}
if (data['data'].length >= 5) {
$.msg($.name, '', `京东账号 ${$.index}${$.nickName}\n恭喜你,已集成五福汪可合成分红JOY了`)
if ($.isNode()) await notify.sendNotify(`${$.name} - ${$.index} - ${$.nickName}`, `京东账号 ${$.index}${$.nickName}\n恭喜你,已集成五福汪可合成分红JOY了`);
}
}
}
}
}
} catch (e) {
$.logErr(e, resp)
} finally {
resolve();
}
})
})
}
function obtainAward(eventRecordId) {
return new Promise(async resolve => {
const body = {"eventType": "GROWTH_REWARD", eventRecordId};
Expand All @@ -633,7 +680,7 @@ function obtainAward(eventRecordId) {
}
function showMsg() {
return new Promise(async resolve => {
message += `当前信息${$.bean}京豆,${$.coin}金币`
message += `\n当前信息${$.bean}京豆,${$.coin}金币`
$.msg($.name, '', `京东账号${$.index} ${$.nickName}\n${message}`)
resolve()
})
Expand Down Expand Up @@ -802,7 +849,6 @@ function jsonParse(str) {
}
}
/**
* 生成随机数字
* @param {number} min 最小值(包含)
* @param {number} max 最大值(不包含)
Expand Down
4 changes: 2 additions & 2 deletions jd_crazy_joy_coin.js
Original file line number Diff line number Diff line change
Expand Up @@ -456,13 +456,13 @@ function mergeJoy(x, y) {
case 1006:
return '省钱JOY'
case 1007:
return '咚咚JOY'
return '东东JOY'
default:
return '未知JOY'
}
}
console.log(`合并成功,获得${level(data.data.newJoyId)}级Joy`)
if (level(data.data.newJoyId) === '咚咚JOY' && $.isNode()) await notify.sendNotify($.name, `京东账号${$.index} ${$.nickName}\n合并成功,获得${level(data.data.newJoyId)}级Joy`)
if (data.data.newJoyId === 1007 && $.isNode()) await notify.sendNotify($.name, `京东账号${$.index} ${$.nickName}\n合并成功,获得${level(data.data.newJoyId)}级Joy`)
} else {
console.log(`合并成功,获得${data.data.newJoyId}级Joy`)
}
Expand Down
Loading

0 comments on commit 3ddb1da

Please sign in to comment.