Created
November 13, 2022 21:58
-
-
Save mikeyaworski/721d9a461ec047781edeedae4ecefa7e to your computer and use it in GitHub Desktop.
Auto Claim Twitch Channel Points (Interval)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Auto Claim Twitch Channel Points (Interval) | |
// @namespace http://tampermonkey.net/ | |
// @version 2.0.0 | |
// @description Auto Claim Twitch Channel Points | |
// @author https//github.com/mikeyaworski | |
// @match https://www.twitch.tv/* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=twitch.tv | |
// @grant none | |
// ==/UserScript== | |
function log(...args) { | |
console.log('Auto Claim Twitch Channel Points:', ...args); | |
} | |
let intervalId; | |
function teardownInterval() { | |
log('Clearing interval', intervalId); | |
if (intervalId) { | |
clearInterval(intervalId); | |
} | |
} | |
function createInterval() { | |
intervalId = setInterval(() => { | |
const element = document.querySelector('.community-points-summary > *:nth-child(2) button'); | |
if (element) { | |
log('Claiming bonus', element); | |
element.click(); | |
} | |
}, 1000); | |
log('Created interval', intervalId); | |
} | |
createInterval(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment