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

Function taskList

jd_mcxhd.js:234–273  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

232 })
233}
234function taskList() {
235 return new Promise(resolve => {
236 $.get(taskUrl('taskList'), async (err, resp, data) => {
237 try {
238 if (err) {
239 console.log(`${JSON.stringify(err)}`)
240 console.log(`${$.name} API请求失败,请检查网路重试`)
241 } else {
242 if (safeGet(data)) {
243 data = JSON.parse(data);
244 if (data.retCode === '200') {
245 for(let vo of data.result.tasks){
246 if(vo.times < vo.maxTimes)
247 for(let bo of vo.subItem){
248 if (vo.taskType === '6'){
249 const shareCode = bo.itemToken
250 console.log(`好友助力码:${shareCode}`)
251 if (shareCode) $.shareCodeList.push(shareCode)
252 }
253 else if(vo.taskType!=='9') {
254 await doTask(bo.itemToken)
255 }
256 else{
257 await doTask(bo.itemToken,bo.taskToken)
258 }
259 }
260 }
261 } else {
262 console.log(`抽奖失败`)
263 }
264 }
265 }
266 } catch (e) {
267 $.logErr(e, resp)
268 } finally {
269 resolve();
270 }
271 })
272 })
273}
274function startGame() {
275 return new Promise(resolve => {
276 $.get(taskUrl('startGame'), async (err, resp, data) => {

Callers 1

superBoxFunction · 0.70

Calls 6

taskUrlFunction · 0.70
safeGetFunction · 0.70
doTaskFunction · 0.70
getMethod · 0.45
logMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected