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

Function doTask

jd_pet.js:199–245  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

197
198
199async function doTask() {
200 const { signInit, threeMealInit, firstFeedInit, feedReachInit, inviteFriendsInit, browseShopsInit, taskList } = $.taskInfo;
201 for (let item of taskList) {
202 if ($.taskInfo[item].finished) {
203 console.log(`任务 ${item} 已完成`)
204 }
205 }
206 //每日签到
207 if (signInit && !signInit.finished) {
208 await signInitFun();
209 }
210 // 首次喂食
211 if (firstFeedInit && !firstFeedInit.finished) {
212 await firstFeedInitFun();
213 }
214 // 三餐
215 if (threeMealInit && !threeMealInit.finished) {
216 if (threeMealInit.timeRange === -1) {
217 console.log(`未到三餐时间`);
218 } else {
219 await threeMealInitFun();
220 }
221 }
222 if (browseShopsInit && !browseShopsInit.finished) {
223 await browseShopsInitFun();
224 }
225 let browseSingleShopInitList = [];
226 taskList.map((item) => {
227 if (item.indexOf('browseSingleShopInit') > -1) {
228 browseSingleShopInitList.push(item);
229 }
230 });
231 // 去逛逛好货会场
232 for (let item of browseSingleShopInitList) {
233 const browseSingleShopInitTask = $.taskInfo[item];
234 if (browseSingleShopInitTask && !browseSingleShopInitTask.finished) {
235 await browseSingleShopInit(browseSingleShopInitTask);
236 }
237 }
238 if (inviteFriendsInit && !inviteFriendsInit.finished) {
239 await inviteFriendsInitFun();
240 }
241 // 投食10次
242 if (feedReachInit && !feedReachInit.finished) {
243 await feedReachInitFun();
244 }
245}
246// 好友助力信息
247async function masterHelpInit() {
248 let res = await request(arguments.callee.name.toString());

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