🏠 返回首頁 

Greasy Fork is available in English.

get first bonus

just autotake first bonus from chanel points in twitch

  1. // ==UserScript==
  2. // @name get first bonus
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description just autotake first bonus from chanel points in twitch
  6. // @author You
  7. // @match https://www.twitch.tv/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=twitch.tv
  9. // @grant none
  10. // @license MIT
  11. // ==/UserScript==
  12. function clickElementByXPath(xpath) {
  13. const element = document.evaluate(xpath, document, null, XPathR###lt.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
  14. if (element) {
  15. element.click();
  16. return true;
  17. }
  18. return false;
  19. }
  20. // vovapain first
  21. var buttonPoints ='//*[@id="live-page-chat"]/div/div/div[2]/div/div/section/div/seventv-container/div/div[2]/div[2]/div[1]/div/div/div/div[1]/div[2]/button'
  22. var buttonTask = '//*[@id="channel-points-reward-center-body"]/div/div/div[5]/div/button/div'
  23. var buttonAcccept ='//*[@id="channel-points-reward-center-body"]/div/div/div[3]/div/button'
  24. function clElcl(){
  25. clickElementByXPath(buttonPoints)
  26. clickElementByXPath(buttonTask)
  27. clickElementByXPath(buttonAcccept)
  28. }
  29. (function() {
  30. 'use strict';
  31. document.addEventListener("keydown", (event) => {
  32. if (event.key === "F9") {
  33. console.log("F9 key pressed");
  34. clElcl()
  35. // Действия, которые нужно выполнить при нажатии на кнопку F12
  36. }
  37. });
  38. // Your code here...
  39. })();