Qidian score autoclick

Open the score site and let the script do all the click!

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name                Qidian score autoclick
// @name:ZH-CN          起点中文经验值自动签到
// @namespace           http://tampermonkey.net/
// @version             1.9
// @description         Open the score site and let the script do all the click!
// @description:ZH-CN   打开领取经验值的页面,然后让脚本在后台自动处理所有工作!
// @author              SLAPaper
// @include             /^https?://my\.qidian\.com/level/
// @license             MIT
// ==/UserScript==

(function() {
    'use strict';

    function clicker() {
        let expList = document.getElementsByClassName("elGetExp");

        if (expList.length > 0) {
            expList[0].click();
        }
    }

    function refresher() {
        window.location.reload(true);
    }

    window.addEventListener("load", clicker);
    setInterval(clicker, 60*1000);
    setInterval(refresher, 30*60*1000); // handle cross day or browser sleep
})();