MCPcopy Index your code
hub / github.com/smallfawn/QLScriptPublic / doTasks

Method doTasks

wxapp/junpinhui.js:579–595  ·  view source on GitHub ↗
(tasks)

Source from the content-addressed store, hash-verified

577 }
578
579 async doTasks(tasks) {
580 const pending = tasks.filter((task) => !isCompleted(task));
581 if (!pending.length) {
582 $.log(`账号[${this.index}] 暂无未完成任务`);
583 return;
584 }
585 for (const task of pending) {
586 const code = task.code || "";
587 if (code === "answer_survey") await this.doQuestionTask();
588 else if (code === "garden_share") await this.doShareTask();
589 else if (code === "view_organic_sorghum") await this.doRealityTask();
590 else if (code === "complete_member_info") await this.doCompleteInfoTask();
591 else if (/subscribe/i.test(code)) await this.doSubscribePrize();
592 else $.log(`账号[${this.index}] 未适配任务: ${task.name || code || task.id}`);
593 await $.wait(500, 1200);
594 }
595 }
596
597 async run() {
598 $.log(`\n账号[${this.index}] ${mask(this.openid || this.cacheKey)}`);

Callers 1

runMethod · 0.95

Calls 8

doQuestionTaskMethod · 0.95
doShareTaskMethod · 0.95
doRealityTaskMethod · 0.95
doCompleteInfoTaskMethod · 0.95
doSubscribePrizeMethod · 0.95
isCompletedFunction · 0.85
logMethod · 0.45
waitMethod · 0.45

Tested by

no test coverage detected