MCPcopy Index your code
hub / github.com/hoothin/UserScripts / checkRush

Function checkRush

T66y tool/T66y tool.user.js:293–327  ·  view source on GitHub ↗
(timeGap)

Source from the content-addressed store, hash-verified

291 }, gap);
292 }
293 function checkRush(timeGap) {
294 setTimeout(() => {
295 let date = new Date();
296 if (date.getHours() == 0) {
297 textarea.val("今日签到");
298 submitReply();
299 let rushTimes = 5;
300 let rushTimer = setInterval(() => {
301 if (--rushTimes > 0) {
302 requestRush(100);
303 } else {
304 clearInterval(rushTimer);
305 rushReply.val("搶簽結束");
306 }
307 }, 5);
308 } else {
309 if (reachRushMinute) {
310 if (date.getSeconds() == 59) {
311 checkRush(1);
312 } else if (date.getSeconds() > 57) {
313 checkRush(5);
314 } else if (date.getSeconds() > 50) {
315 checkRush(500);
316 } else {
317 checkRush(1000);
318 }
319 } else if (date.getHours() == 23 && date.getMinutes() == 59) {
320 reachRushMinute = true;
321 checkRush(1000);
322 } else {
323 checkRush(5000);
324 }
325 }
326 }, timeGap);
327 }
328 rushReply.insertAfter( "form .btn:last-child" );
329 rushReply.click(function() {
330 checkRush(5000);

Callers 1

t66yFunction · 0.85

Calls 2

submitReplyFunction · 0.85
requestRushFunction · 0.85

Tested by

no test coverage detected