Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
This code collects automatically the channel points chest which pops up every 15 minutes.
// open a twitch channel with channel points
// open chat or popout chat
// open inspector (Opera: CTRL + SHIFT + C, Chrome: CTRL + SHIFT + I, Firefox: F12)
// open console in tab
// copy / paste code + ENTER
// only works if you view a live stream. (just open chat is not enough)
var chestPoints = 0;
document.querySelector('.community-points-summary button').click();
var multiplier = document.querySelector('#channel-points-reward-center-header h6') !== null ? 2 : 1;
document.querySelector('#channel-points-reward-center-body button.tw-align-items-center.tw-align-middle.tw-border-bottom-left-radius-small').click();
var specialPoints = parseInt(document.querySelector('.reward-center-body div div.tw-align-items-center.tw-justify-content-between:nth-child(2)>p').textContent.replace('+', '')) * multiplier;
document.querySelector('.reward-center__content button[aria-label="Close"]').click();
console.log('Twitch Chest Auto Click has started');
document.querySelector('.community-points-summary').style.backgroundColor = '#772ce8';
document.querySelector('.community-points-summary').style.borderRadius = '5px';
setInterval(function() {
if (document.querySelector(".chat-input__buttons-container .tw-button.tw-button--success.tw-interactive") !== null) {
document.querySelector(".chat-input__buttons-container .tw-button.tw-button--success.tw-interactive").click();
chestPoints += specialPoints;
// hours and minutes with leading zero
var hours = ('0' + (new Date()).getHours()).slice(-2);
var minutes = ('0' + (new Date()).getMinutes()).slice(-2);
console.log('Points: ' + chestPoints);
console.log('Time: ' + hours + ':' + minutes);
} else {
//console.log('nothing \T-T/');
}
}, 10000);
// or add script as browser bookmark
javascript:!function(){var t=0;document.querySelector(".community-points-summary button").click();var e=null!==document.querySelector("#channel-points-reward-center-header h6")?2:1;document.querySelector("#channel-points-reward-center-body button.tw-align-items-center.tw-align-middle.tw-border-bottom-left-radius-small").click();var n=parseInt(document.querySelector(".reward-center-body div div.tw-align-items-center.tw-justify-content-between:nth-child(2)>p").textContent.replace("+",""))*e;document.querySelector('.reward-center__content button[aria-label="Close"]').click(),console.log("Twitch Chest Auto Click has started"),document.querySelector(".community-points-summary").style.backgroundColor="#772ce8",document.querySelector(".community-points-summary").style.borderRadius="5px",setInterval(function(){if(null!==document.querySelector(".chat-input__buttons-container .tw-button.tw-button--success.tw-interactive")){document.querySelector(".chat-input__buttons-container .tw-button.tw-button--success.tw-interactive").click(),t+=n;var e=("0"+(new Date).getHours()).slice(-2),o=("0"+(new Date).getMinutes()).slice(-2);console.log("Points: "+t),console.log("Time: "+e+":"+o)}},1e4)}();
// ---
@InsanityMeetsHH

This comment has been minimized.

Copy link
Owner Author

InsanityMeetsHH commented Feb 12, 2020

Purple background color shows that script has started
chest-click-active

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.