起点中文经验值自动签到

打开领取经验值的页面,然后让脚本在后台自动处理所有工作!

  1. // ==UserScript==
  2. // @name Qidian score autoclick
  3. // @name:ZH-CN 起点中文经验值自动签到
  4. // @namespace http://tampermonkey.net/
  5. // @version 1.9
  6. // @description Open the score site and let the script do all the click!
  7. // @description:ZH-CN 打开领取经验值的页面,然后让脚本在后台自动处理所有工作!
  8. // @author SLAPaper
  9. // @include /^https?://my\.qidian\.com/level/
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. function clicker() {
  17. let expList = document.getElementsByClassName("elGetExp");
  18.  
  19. if (expList.length > 0) {
  20. expList[0].click();
  21. }
  22. }
  23.  
  24. function refresher() {
  25. window.location.reload(true);
  26. }
  27.  
  28. window.addEventListener("load", clicker);
  29. setInterval(clicker, 60*1000);
  30. setInterval(refresher, 30*60*1000); // handle cross day or browser sleep
  31. })();