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)
if (document.querySelector('.community-points-summary').style.backgroundColor === '') {
var chestPoints = 0;
document.querySelector('.community-points-summary button').click();
var multiplier = 1;
if (confirm('Did you Subscribe to this Channel?')) {
if (confirm('Are you Tier 1 Subscriber?')) {
multiplier = 1.2;
} else if (confirm('Are you Tier 2 Subscriber?')) {
multiplier = 1.4;
} else if (confirm('Are you Tier 3 Subscriber?')) {
multiplier = 2;
}
}
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 = 'rgb(119, 44, 232)';
document.querySelector('.community-points-summary').style.borderRadius = '5px';
window.twitchChestAutoClickInterval = 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);
} else {
console.log('Twitch Chest Auto Click has stopped');
document.querySelector('.community-points-summary').style.backgroundColor = '';
clearInterval(window.twitchChestAutoClickInterval);
}
// or add script as browser bookmark
javascript:!function(){if(document.querySelector(".community-points-summary").style.backgroundColor===""){var n=0;document.querySelector(".community-points-summary button").click();var t=1;if(confirm("Did you Subscribe to this Channel?")){if(confirm("Are you Tier 1 Subscriber?")){t=1.2}else if(confirm("Are you Tier 2 Subscriber?")){t=1.4}else if(confirm("Are you Tier 3 Subscriber?")){t=2}}document.querySelector("#channel-points-reward-center-body button.tw-align-items-center.tw-align-middle.tw-border-bottom-left-radius-small").click();var o=parseInt(document.querySelector(".reward-center-body div div.tw-align-items-center.tw-justify-content-between:nth-child(2)>p").textContent.replace("+",""))*t;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="rgb(119, 44, 232)";document.querySelector(".community-points-summary").style.borderRadius="5px";window.t=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();n+=o;var t=("0"+(new Date).getHours()).slice(-2);var e=("0"+(new Date).getMinutes()).slice(-2);console.log("Points: "+n);console.log("Time: "+t+":"+e)}else{}},1e4)}else{console.log("Twitch Chest Auto Click has stopped");document.querySelector(".community-points-summary").style.backgroundColor="";clearInterval(window.t)}}();
// ---
@InsanityMeetsHH

This comment has been minimized.

Copy link
Owner Author

@InsanityMeetsHH 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.