Twitch Auto Channel Points Claimer

Automatically claim channel points.

  1. // ==UserScript==
  2. // @name Twitch Auto Channel Points Claimer
  3. // @version 1.6
  4. // @author PartMent
  5. // @description Automatically claim channel points.
  6. // @match https://www.twitch.tv/*
  7. // @match https://dashboard.twitch.tv/*
  8. // @license MIT
  9. // @grant none
  10. // @namespace https://greasyfork.org/users/310437
  11. // ==/UserScript==
  12.  
  13. let MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver;
  14. let claiming = false;
  15. if (MutationObserver) console.log('Auto claimer is enabled.');
  16. let observer = new MutationObserver(e => {
  17. let bonus = document.querySelector('.claimable-bonus__icon');
  18. if (bonus && !claiming) {
  19. bonus.click();
  20. let date = new Date();
  21. claiming = true;
  22. setTimeout(() => {
  23. console.log('Claimed at '+date);
  24. claiming = false;
  25. }, Math.random() * 1000 + 2000);
  26. }
  27. });
  28. observer.observe(document.body, {childList: true, subtree: true});