get first bonus

just autotake first bonus from chanel points in twitch

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

You will need to install an extension such as Tampermonkey to install this script.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

// ==UserScript==
// @name         get first bonus
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  just autotake first bonus from chanel points in twitch
// @author       You
// @match        https://www.twitch.tv/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=twitch.tv
// @grant        none
// @license MIT
// ==/UserScript==
function clickElementByXPath(xpath) {
    const element = document.evaluate(xpath, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
    if (element) {
      element.click();
      return true;
    }
    return false;
  }


// vovapain first
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'
var buttonTask = '//*[@id="channel-points-reward-center-body"]/div/div/div[5]/div/button/div'
var buttonAcccept ='//*[@id="channel-points-reward-center-body"]/div/div/div[3]/div/button'

function clElcl(){
    clickElementByXPath(buttonPoints)
    clickElementByXPath(buttonTask)
    clickElementByXPath(buttonAcccept)
}
(function() {
    'use strict';
        document.addEventListener("keydown", (event) => {
            if (event.key === "F9") {
                console.log("F9 key pressed");
                clElcl()
                // Действия, которые нужно выполнить при нажатии на кнопку F12
            }
    });

    // Your code here...
})();