Last active
October 3, 2020 01:30
-
-
Save sqbs/1119236e0f7b99096aea700f34d98cd2 to your computer and use it in GitHub Desktop.
Twitch Auto Bonus Points
This file contains 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
Gives an extra 200 points per hour | |
How To Use: | |
- Add the script as a bookmark in your toolbar | |
- Open a streamer's channel that uses loyalty points | |
- Toggle on/off as needed | |
Tips: | |
- Can't pause stream so set it to 160p and mute the player (or tab) | |
- Only 2 channels at the same time due to Twitch limitations (active stream and oldest session, limited to 2) | |
- Use the second (optional) script to kill chat so it doesn't lag your browser. Requires page refresh to restore | |
- Use the third (optional) script to toggle show/hide on the stream and take it easy on your GPU | |
- Use the fourth (optional) script to collect raid bonuses before redirecting back to the original streamer | |
Scripts: | |
// toggle auto claim bonus on/off | |
javascript:function click(t,i){var n=document.createEvent("MouseEvent"),o=document.elementFromPoint(t,i);n.initMouseEvent("click",!0,!0,window,null,t,i,0,0,!1,!1,!1,!1,0,null),o.dispatchEvent(n)}if(typeof bonus=='number'){clearInterval(bonus);clearInterval(bonus_title);var bonus=null,bonus_title=null;if(document.querySelector('.channel-page__panel-container').firstChild.firstChild.getAttribute('original-title')!=null){window.document.title=document.querySelector('.channel-page__panel-container').firstChild.firstChild.getAttribute('original-title')} document.querySelector('.tw-animated-glitch-logo__body').setAttribute('style','')}else{var bonus=setInterval(function(){if(document.querySelector('.community-points-summary')==null)return!1;if(document.querySelector('div.claimable-bonus__icon')){var chest=document.querySelector('div.claimable-bonus__icon').getBoundingClientRect();click(chest.left+Math.floor((Math.random()*8)+1),chest.top+Math.floor((Math.random()*8)+1));}},3000);var bonus_title=setInterval(function(){if(document.querySelector('.community-points-summary')==null)return!1;if(document.querySelector('.channel-page__panel-container').firstChild.firstChild.getAttribute('original-title')==null){document.querySelector('.channel-page__panel-container').firstChild.firstChild.setAttribute('original-title',window.document.title)} window.document.title='('+document.querySelector('.community-points-summary').firstChild.firstChild.nextSibling.firstChild.nextSibling.innerText.replace(/[^\d,]+/i,'')+') '+document.querySelector('.channel-page__panel-container').firstChild.firstChild.getAttribute('original-title')},3000);document.querySelector('.tw-animated-glitch-logo__body').setAttribute('style','fill:rgb(0,199,172)!important')} | |
// optional: kill twitch chat | |
javascript:document.querySelector('.chat-list__list-container').remove(); | |
// optional: toggle show/hide twitch video | |
javascript:if(document.getElementsByTagName('video')[0].parentElement.hidden==true){document.getElementsByTagName('video')[0].parentElement.hidden=false}else{document.getElementsByTagName('video')[0].parentElement.hidden=true}; | |
// optional: lock tab to streamer | |
javascript:if(typeof lock_timer=='number'){clearInterval(lock_timer);var lock_timer=null;alert('Lock removed for ' + username);} else {var username = (window.location.href).replace('https://www.twitch.tv/', '');if (username != null && username != '') {alert('Locking tab to ' + username);var lock_timer = setInterval(function(){if (window.location.href != 'https://www.twitch.tv/' + username) {history.back()} }, 60 * 1000);} else {alert("Use this on a streamer's channel");}} | |
Change Log: | |
(2020-01-05) changed: lock tab now uses the current url | |
added: lock tab 60 second delay before pressing back button | |
(2019-12-29) fixed: lock tab now uses the back button instead of redirecting | |
(2019-11-13) changed: spoof x/y when clicking | |
(2019-11-01) added: Optional script to lock/redirect back to a specified streamer | |
(2019-10-30) added: Total points now shown in the tab/page title | |
fixed: Now stays active when switching between channels that do/don't use loyalty points | |
(2019-10-29) added: Optional scripts | |
changed: Merged on/off script into one toggle |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Icon will turn teal/purple when turned on/off