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

Method autoTasks

daily/hyjk.js:429–499  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

427 }
428
429 async autoTasks() {
430 try {
431 const firstTaskRes = await this.getTaskListNew();
432 const firstTaskList = this.flattenTaskList(firstTaskRes);
433 $.log(`[账号${this.index}] taskList数量: ${firstTaskList.length}`);
434 for (const item of firstTaskList) {
435 const taskType = Number(item?.taskType);
436 const taskStatus = Number(item?.taskStatus);
437 const taskId = Number(item?.taskId);
438 if (!taskId) continue;
439 this.logTaskItem(item, "scan");
440
441 if (taskType === 50 && (taskStatus === 0 || taskStatus === 3)) {
442 await this.autoBrowseTask(item);
443 continue;
444 }
445
446 if (taskType === 70 && taskStatus === 0) {
447 const opRes = await this.userOperation(9, { taskId });
448 $.log(`[账号${this.index}] task70(taskId=${taskId}) 上报: ${opRes?.msg || opRes?.code}`);
449 await $.wait(500);
450 continue;
451 }
452
453 if (taskType === 80 && (taskStatus === 0 || taskStatus === 3)) {
454 await this.autoBlindBox(taskId);
455 continue;
456 }
457
458 if ((taskType === 60 || taskType === 61) && taskStatus === 0) {
459 await this.claimTaskWater(item, "task60/61直领");
460 await $.wait(500);
461 continue;
462 }
463
464 if (taskType === 90 && (taskStatus === 0 || taskStatus === 3)) {
465 await this.claimTaskWater(item, "task90直领");
466 await $.wait(500);
467 continue;
468 }
469
470 if ((taskType === 110 || taskType === 120) && (taskStatus === 0 || taskStatus === 3)) {
471 const jumpRes = await this.goFruitOrGarden(taskId);
472 $.log(`[账号${this.index}] task${taskType}(taskId=${taskId}) goFruitOrGarden: ${jumpRes?.msg || jumpRes?.code}`);
473 await $.wait(500);
474 continue;
475 }
476
477 if (taskStatus === 1) {
478 await this.claimTaskWater(item, "立即领奖");
479 await $.wait(500);
480 continue;
481 }
482
483 if (taskStatus !== 2 && taskStatus !== 10000) {
484 $.log(`[账号${this.index}] 未适配任务: taskType=${taskType}, taskStatus=${taskStatus}, taskId=${taskId}`);
485 }
486 }

Callers 1

autoByUserOperationMethod · 0.95

Calls 11

getTaskListNewMethod · 0.95
flattenTaskListMethod · 0.95
logTaskItemMethod · 0.95
autoBrowseTaskMethod · 0.95
userOperationMethod · 0.95
autoBlindBoxMethod · 0.95
claimTaskWaterMethod · 0.95
goFruitOrGardenMethod · 0.95
normalizeTaskNumberMethod · 0.95
logMethod · 0.45
waitMethod · 0.45

Tested by

no test coverage detected