Auto click Claim Button

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

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

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

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

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

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

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

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

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Auto click Claim Button
// @namespace    Auto click Claim Button
// @version      1.2
// @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().includes('claim'));

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

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

    function startProcess() {
        setTimeout(() => {
            // 檢查是否存在 CAPTCHA
            if (document.body.innerText.includes('CAPTCHA')) {
                refreshPage();
            } else {
                clickClaimButton(); // 嘗試點擊 Claim 按鈕
            }
            startProcess(); // 循環調用
        }, 10000); // 等待10秒
    }

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