自動點擊 Claim 按鈕的腳本

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

目前為 2024-11-21 提交的版本,檢視 最新版本

// ==UserScript==
// @name         自動點擊 Claim 按鈕的腳本
// @namespace    http://tampermonkey.net/
// @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();
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址