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

Function pasture

jd_jxmc.js:86–203  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

84 })
85
86async function pasture() {
87 try {
88 $.homeInfo = {};
89 $.petidList = [];
90 $.crowInfo = {};
91 await takeGetRequest('GetHomePageInfo');
92 if (JSON.stringify($.homeInfo) === '{}') {
93 return;
94 } else {
95 if (!$.homeInfo.petinfo) {
96 console.log(`\n温馨提示:${$.UserName} 请先手动完成【新手指导任务】再运行脚本再运行脚本\n`);
97 return;
98 }
99 console.log('获取活动信息成功');
100 for (let i = 0; i < $.homeInfo.petinfo.length; i++) {
101 $.onepetInfo = $.homeInfo.petinfo[i];
102 $.petidList.push($.onepetInfo.petid);
103 if ($.onepetInfo.cangetborn === 1) {
104 console.log(`开始收鸡蛋`);
105 await takeGetRequest('GetEgg');
106 await $.wait(1000);
107 }
108 }
109 $.crowInfo = $.homeInfo.cow;
110 }
111
112 await $.wait(2000);
113 if ($.crowInfo.lastgettime) {
114 console.log('收奶牛金币');
115 await takeGetRequest('cow');
116 await $.wait(2000);
117 }
118 $.taskList = [];
119 $.dateType = ``;
120 for (let j = 2; j >= 0; j--) {
121 if (j === 0) {
122 $.dateType = ``;
123 } else {
124 $.dateType = j;
125 }
126 await takeGetRequest('GetUserTaskStatusList');
127 await $.wait(2000);
128 await doTask();
129 await $.wait(2000);
130 if (j === 2) {
131 //割草
132 console.log(`\n开始进行割草`);
133 $.runFlag = true;
134 for (let i = 0; i < 30 && $.runFlag; i++) {
135 $.mowingInfo = {};
136 console.log(`开始第${i + 1}次割草`);
137 await takeGetRequest('mowing');
138 await $.wait(2000);
139 if ($.mowingInfo.surprise === true) {
140 //除草礼盒
141 console.log(`领取除草礼盒`);
142 await takeGetRequest('GetSelfResult');
143 await $.wait(5000);

Callers 1

jd_jxmc.jsFile · 0.85

Calls 5

takeGetRequestFunction · 0.70
doTaskFunction · 0.70
logMethod · 0.45
waitMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected