MCPcopy Create free account
hub / github.com/NobyDa/Script / checkIsAllProcessed

Function checkIsAllProcessed

BDTieBa-DailyBonus/TieBa.js:207–229  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

205}
206
207function checkIsAllProcessed() {
208 //$nobyda.notify("贴吧签到", `最终进度${process.result.length}/${process.total}`, "");
209 if (process.result.length != process.total) return;
210 for (var i = 0; i < Math.ceil(process.total / singleNotifyCount); i++) {
211 var notify = "";
212 var spliceArr = process.result.splice(0, singleNotifyCount);
213 var notifySuccessCount = 0;
214 for (const res of spliceArr) {
215 if (res.errorCode == 0 || res.errorCode == 9999) {
216 notifySuccessCount++;
217 }
218 if (res.errorCode == 9999) {
219 notify += `【${res.bar}】已经签到,当前等级${res.level},经验${res.exp}
220`;
221 } else {
222 notify += `【${res.bar}】${res.errorCode==0?'签到成功':'签到失败'},${res.errorCode==0?res.errorMsg:('原因:'+res.errorMsg)}
223`;
224 }
225 }
226 $nobyda.notify("贴吧签到", `签到${spliceArr.length}个,成功${notifySuccessCount}个`, notify);
227 $nobyda.done()
228 }
229}
230
231function GetCookie() {
232 let headerCookie = $request.headers["Cookie"] || $request.headers["cookie"];

Callers 2

signBarFunction · 0.85
signBarsFunction · 0.85

Calls 2

notifyMethod · 0.45
doneMethod · 0.45

Tested by

no test coverage detected