Advertisement
Guest User

Claim Points

a guest
Oct 18th, 2019
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Claim Points
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description try to take over the world!
  6. // @author You
  7. // @match https://www.twitch.tv/*
  8. // @match www.twitch.tv/*
  9. // @match https://www.twitch.tv/esfandtv
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13.  
  14. function getElementByXpath(path) {
  15. return document.evaluate(path, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
  16. }
  17.  
  18. function claimPoints() {
  19. let claimButton = getElementByXpath('//div[@class="tw-absolute"]//button');
  20. if (claimButton !== null) {
  21. claimButton.click();
  22. console.log('Points claimed!')
  23. }
  24. }
  25.  
  26. window.addEventListener('load', function(){
  27. setInterval(claimPoints, 5000)
  28. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement