Twitch Channel Points Collector

It claims the bonus channel points. Checks every 5 seconds.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name          Twitch Channel Points Collector
// @version       1.1
// @description   It claims the bonus channel points. Checks every 5 seconds.
// @author        MrMike
// @namespace     MrMike/Twitch
// @match         https://*.twitch.tv/*
// @grant         none
// @noframes
// ==/UserScript==

(function () {
	"use strict";

	function executeCode(f) {
		var script = document.createElement("script");
		script.id = "injectedScript";
		script.appendChild(document.createTextNode(`(${f.toString()})()`));
		(document.body || document.head || document.documentElement).appendChild(script);
	}

	executeCode(() => {
		function claimBonus() {
			let cbi = document.getElementsByClassName("claimable-bonus__icon");
			if (cbi.length > 0) {
				setTimeout(() => {
					cbi[0].click();
				}, 250);
			}
		}
		setInterval(claimBonus, 5000);
	});
})();