Auto click Claim Button

自動點擊 "Claim" 按鈕,處理 CAPTCHA 並循環操作

Verze ze dne 21. 11. 2024. Zobrazit nejnovější verzi.

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

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

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         Auto click Claim Button
// @namespace    Auto click Claim Button
// @version      1.0
// @description  自動點擊 "Claim" 按鈕,處理 CAPTCHA 並循環操作
// @author       Your Name
// @match        *://*/*  // 這裡可以替換為特定的水龍頭網站 URL
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    function clickClaimButton() {
        const buttons = Array.from(document.querySelectorAll("button, a")); // 查找所有按鈕和鏈接
        const claimButton = buttons.find(btn => btn.textContent.trim().toLowerCase() === 'claim');

        if (claimButton) {
            claimButton.click();
            console.log('已點擊 Claim 按鈕!');
        } else {
            console.log('找不到 Claim 按鈕。');
        }
    }

    function refreshPage() {
        console.log('因為 CAPTCHA 而刷新頁面...');
        location.reload();
    }

    function startProcess() {
        setTimeout(() => {
            if (document.body.innerText.includes('CAPTCHA')) {
                refreshPage();
            } else {
                clickClaimButton();
            }
            startProcess(); // 循環調用
        }, 10000); // 等待10秒
    }

    // 啟動腳本
    startProcess();
})();