KingRan 2022-02-27 10:31:35 +08:00
parent 3c36dd4991
commit 35b674d012
2 changed files with 15 additions and 6 deletions

View File

@ -183,7 +183,8 @@ async function feedPetsAgain() {
if (foodAmount - 100 >= 10) { if (foodAmount - 100 >= 10) {
for (let i = 0; i < parseInt((foodAmount - 100) / 10); i++) { for (let i = 0; i < parseInt((foodAmount - 100) / 10); i++) {
const feedPetRes = await request('feedPets'); const feedPetRes = await request('feedPets');
console.log(`投食feedPetRes`); await $.wait(5 * 1000);
console.log(`投食feedPetRes`);
if (feedPetRes.resultCode == 0 && feedPetRes.code == 0) { if (feedPetRes.resultCode == 0 && feedPetRes.code == 0) {
console.log('投食成功') console.log('投食成功')
} }
@ -256,7 +257,13 @@ async function doTask() {
} }
// 投食10次 // 投食10次
if (feedReachInit && !feedReachInit.finished) { if (feedReachInit && !feedReachInit.finished) {
await feedReachInitFun(); lnrun++;
await feedReachInitFun();
if (lnrun == 5) {
console.log(`\n【访问接口次数达到5次休息半分钟.....】\n`);
await $.wait(30 * 1000);
lnrun = 0;
}
} }
} }
// 好友助力信息 // 好友助力信息
@ -418,10 +425,11 @@ async function feedReachInitFun() {
console.log('投食任务开始...'); console.log('投食任务开始...');
let finishedTimes = $.taskInfo.feedReachInit.hadFeedAmount / 10; //已经喂养了几次 let finishedTimes = $.taskInfo.feedReachInit.hadFeedAmount / 10; //已经喂养了几次
let needFeedTimes = 10 - finishedTimes; //还需要几次 let needFeedTimes = 10 - finishedTimes; //还需要几次
let tryTimes = 20; //尝试次数 let tryTimes = 10; //尝试次数
do { do {
console.log(`还需要投食${needFeedTimes}`); console.log(`还需要投食${needFeedTimes}`);
const response = await request('feedPets'); const response = await request('feedPets');
await $.wait(5 * 1000);
console.log(`本次投食结果: ${JSON.stringify(response)}`); console.log(`本次投食结果: ${JSON.stringify(response)}`);
if (response.resultCode == 0 && response.code == 0) { if (response.resultCode == 0 && response.code == 0) {
needFeedTimes--; needFeedTimes--;
@ -498,7 +506,7 @@ function TotalBean() {
} }
// 请求 // 请求
async function request(function_id, body = {}) { async function request(function_id, body = {}) {
await $.wait(6000); //歇口气儿, 不然会报操作频繁 await $.wait(10 * 1000); //歇口气儿, 不然会报操作频繁
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
$.post(taskUrl(function_id, body), (err, resp, data) => { $.post(taskUrl(function_id, body), (err, resp, data) => {
try { try {

View File

@ -85,7 +85,7 @@ console.log(`共${cookiesArr.length}个京东账号\n`);
taskInfoKey = []; taskInfoKey = [];
option = {}; option = {};
await GetShareCode(); await GetShareCode();
await $.wait(3 * 1000); await $.wait(4 * 1000);
} }
} }
console.log('\n互助码收集完毕开始执行内部助力...\n'); console.log('\n互助码收集完毕开始执行内部助力...\n');
@ -183,6 +183,7 @@ async function jdPet() {
$.taskInfo = $.taskInit.result; $.taskInfo = $.taskInit.result;
if (llhelp){ if (llhelp){
await slaveHelp(); //助力好友 await slaveHelp(); //助力好友
await $.wait(30 * 1000);
} }
await showMsg(); await showMsg();
@ -455,7 +456,7 @@ function TotalBean() {
} }
// 请求 // 请求
async function request(function_id, body = {}) { async function request(function_id, body = {}) {
await $.wait(3000); //歇口气儿, 不然会报操作频繁 await $.wait(10000); //歇口气儿, 不然会报操作频繁
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
$.post(taskUrl(function_id, body), (err, resp, data) => { $.post(taskUrl(function_id, body), (err, resp, data) => {
try { try {