Twitch Points Claimer

Claims twitch bonus points automatically

目前为 2020-10-27 提交的版本。查看 最新版本

// ==UserScript==
// @name         Twitch Points Claimer
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Claims twitch bonus points automatically
// @author       willems
// @match https://www.twitch.tv/*
// @match https://dashboard.twitch.tv/*
// @grant window.onurlchange
// ==/UserScript==

var checkInterval = 0;

function intervalInit() {
    checkInterval = setInterval(function() {
        var targetNode = document.querySelector('.community-points-summary');
        if (targetNode) { clearInterval(checkInterval); initMO(targetNode) }
    }, 3000);
}


function initMO(targetNode) {
    console.log('[AutoPointsClicker] Page loaded!');
    var observer = new MutationObserver(function(m) {
        var bonus = document.querySelector('.claimable-bonus__icon');
        if (bonus) {
            setTimeout(() => {
                bonus.click();
                console.log('[AutoPointsClicker] Claimed bonus points.')
            }, Math.random() * 1000 + 2000);
        }
    });

    observer.observe(targetNode, { childList: true, subtree: true });
}

window.addEventListener('urlchange', function() { clearInterval(checkInterval); intervalInit() });
intervalInit();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址