Free-Tether Auto Click on Timer End

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

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 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);
})();