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

Function doTask

jd_jin_tie.js:393–408  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

391 })
392}
393async function doTask() {
394 for (let task of $.willTask) {
395 console.log(`\n开始领取 【${task['name']}】任务`);
396 await receiveMission(task['missionId']);
397 await $.wait(100)
398 if (task.doLink.indexOf('readTime=') !== -1) {
399 const readTime = parseInt(task.doLink.substr(task.doLink.indexOf('readTime=') + 9));
400 await finishReadMission(task['missionId'], readTime);
401 await $.wait(200);
402 } else if (task.detail.indexOf('京东到家') !== -1) {
403
404 } else if ((task.detail.indexOf('关注') !== -1 || task.detail.indexOf('收藏')) && task.doLink.indexOf('shopId') !== -1) {
405 const shopId = task.doLink.substr(task.doLink.indexOf('shopId=') + 7);
406 }
407 }
408}
409function taskUrl(function_id, body, type = 'mission') {
410 return {
411 url: `https://ms.jr.jd.com/gw/generic/${type}/h5/m/${function_id}?reqData=${encodeURIComponent(body)}`,

Callers 1

mainFunction · 0.70

Calls 4

receiveMissionFunction · 0.70
finishReadMissionFunction · 0.70
logMethod · 0.45
waitMethod · 0.45

Tested by

no test coverage detected