SHARE
TWEET

Claim Points

a guest Oct 18th, 2019 115 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top