MCPcopy Create free account
hub / github.com/Toulu-debug/enen / doTask

Function doTask

jd_pet.js:216–262  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

214
215
216async function doTask() {
217 const {signInit, threeMealInit, firstFeedInit, feedReachInit, inviteFriendsInit, browseShopsInit, taskList} = $.taskInfo;
218 for (let item of taskList) {
219 if ($.taskInfo[item].finished) {
220 console.log(`任务 ${item} 已完成`)
221 }
222 }
223 //每日签到
224 if (signInit && !signInit.finished) {
225 await signInitFun();
226 }
227 // 首次喂食
228 if (firstFeedInit && !firstFeedInit.finished) {
229 await firstFeedInitFun();
230 }
231 // 三餐
232 if (threeMealInit && !threeMealInit.finished) {
233 if (threeMealInit.timeRange === -1) {
234 console.log(`未到三餐时间`);
235 } else {
236 await threeMealInitFun();
237 }
238 }
239 if (browseShopsInit && !browseShopsInit.finished) {
240 await browseShopsInitFun();
241 }
242 let browseSingleShopInitList = [];
243 taskList.map((item) => {
244 if (item.indexOf('browseSingleShopInit') > -1) {
245 browseSingleShopInitList.push(item);
246 }
247 });
248 // 去逛逛好货会场
249 for (let item of browseSingleShopInitList) {
250 const browseSingleShopInitTask = $.taskInfo[item];
251 if (browseSingleShopInitTask && !browseSingleShopInitTask.finished) {
252 await browseSingleShopInit(browseSingleShopInitTask);
253 }
254 }
255 if (inviteFriendsInit && !inviteFriendsInit.finished) {
256 await inviteFriendsInitFun();
257 }
258 // 投食10次
259 if (feedReachInit && !feedReachInit.finished) {
260 await feedReachInitFun();
261 }
262}
263
264// 好友助力信息
265async function masterHelpInit() {

Callers 1

jdPetFunction · 0.70

Calls 8

signInitFunFunction · 0.85
firstFeedInitFunFunction · 0.85
threeMealInitFunFunction · 0.85
browseShopsInitFunFunction · 0.85
browseSingleShopInitFunction · 0.85
inviteFriendsInitFunFunction · 0.85
feedReachInitFunFunction · 0.85
logMethod · 0.45

Tested by

no test coverage detected