(timeGap)
| 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); |
no test coverage detected