Skip to content

Instantly share code, notes, and snippets.

@Cosmeen
Created July 19, 2021 11:23
Show Gist options
  • Save Cosmeen/eedee23d148eb658bc1b9e40d672e02b to your computer and use it in GitHub Desktop.
Save Cosmeen/eedee23d148eb658bc1b9e40d672e02b to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name twitch clicky
// @namespace twitch.bits
// @version 0.2
// @description try to take over the world!
// @author You
// @match https://www.twitch.tv/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
setInterval(function(){
var btn = document.querySelector('button[aria-label="Claim Bonus"]');
if (btn !== null) {
var random = getRandom(666,6666);
setTimeout(function(){
btn.click();
}, random);
}
document.querySelector('button[aria-label="Claim Bonus"]').click();
}, 1000);
function getRandom(min, max) {
return Math.random() * (max - min) + min;
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment