Free-Tether Auto Click on Timer End

Automatically click the "Roll Number" button when the timer ends.

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Free-Tether Auto Click on Timer End
// @namespace    http://tampermonkey.net/
// @version      1.5
// @description  Automatically click the "Roll Number" button when the timer ends.
// @author       ALEN
// @icon         https://www.google.com/s2/favicons?sz=64&domain=free-tether.com
// @match        https://www.free-tether.com/free/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Function to check the timer
    const checkTimer = () => {
        const minutesElement = document.querySelector('#cislo1'); // Minutes element
        const secondsElement = document.querySelector('#cislo2'); // Seconds element

        if (minutesElement && secondsElement) {
            const minutes = parseInt(minutesElement.textContent.trim(), 10);
            const seconds = parseInt(secondsElement.textContent.trim(), 10);

            // Check if the timer is at 00:00
            if (minutes === 0 && seconds === 0) {
                console.log('Timer ended. Attempting to click the Roll Number button.');
                const rollButton = document.querySelector('.btn-lg.btn.btn-success'); // Replace with the correct selector for the Roll Number button
                if (rollButton) {
                    rollButton.click();
                    console.log('Roll Number button clicked.');
                } else {
                    console.warn('Roll Number button not found.');
                }
            }
        } else {
            console.warn('Timer elements not found.');
        }
    };

    // Check the timer every second
    setInterval(checkTimer, 3600000);
})();