MCPcopy Create free account
hub / github.com/Semporia/Scripts / getGrowthReward

Function getGrowthReward

jd_crazy_joy.js:451–483  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

449}
450//领取解锁等级奖励(京豆)
451function getGrowthReward() {
452 return new Promise(async resolve => {
453 const body = { "paramData":{"eventType":"GROWTH_REWARD"} };
454 $.get(taskUrl('crazyJoy_event_getGrowthAndSceneState', JSON.stringify(body)), async (err, resp, data) => {
455 try {
456 if (err) {
457 console.log(`${JSON.stringify(err)}`)
458 console.log(`${$.name} API请求失败,请检查网路重试`)
459 } else {
460 if (safeGet(data)) {
461 data = JSON.parse(data);
462 if (data['resultCode'] === '0') {
463 if (data.data) {
464 for (let item of data.data) {
465 if (item.status === 1) {
466 if (item.eventRecordId) await obtainAward(item.eventRecordId);
467 }
468 }
469 if ($.GROWTH_REWARD_BEAN > 0) {
470 message += `解锁等级奖励:获得${$.GROWTH_REWARD_BEAN}京豆\n`;
471 }
472 }
473 }
474 }
475 }
476 } catch (e) {
477 $.logErr(e, resp)
478 } finally {
479 resolve();
480 }
481 })
482 })
483}
484//获取特殊JOY情况
485function getSpecialJoy() {
486 return new Promise(async resolve => {

Callers 1

jdCrazyJoyFunction · 0.85

Calls 6

obtainAwardFunction · 0.85
taskUrlFunction · 0.70
safeGetFunction · 0.70
getMethod · 0.45
logMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected