Auto click Claim Button

自動點擊所有帶有 "Claim" 字眼的按鈕,直到按鈕可用為止,並等待 CAPTCHA 解決。

05.12.2024 itibariyledir. En son verisyonu görün.

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

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.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name         Auto click Claim Button
// @namespace    AutoClickClaimButton
// @version      1.0
// @description  自動點擊所有帶有 "Claim" 字眼的按鈕,直到按鈕可用為止,並等待 CAPTCHA 解決。
// @author       Yueei
// @match        *://*/*  // 這裡設置為所有網站
// @grant        none
// @license      MIT
// ==/UserScript==
 
(function () {
    'use strict';
 
    // 定義 CAPTCHA 檢查的函數
    function checkCaptcha() {
        const captchaSelectors = [
            "iframe[src*='recaptcha']",
            ".g-recaptcha",
            ".h-captcha",
            ".turnstile",
            "[data-sitekey]",
        ];
 
        const captchaElements = captchaSelectors.some(selector => document.querySelector(selector));
 
        if (captchaElements) {
            console.log('檢測到 CAPTCHA,等待解決...');
            return true; // 若發現 CAPTCHA,返回 true 表示有 CAPTCHA
        }
 
        return false; // 若無 CAPTCHA,返回 false 允許進行點擊
    }
 
    // 定義檢查 Claim 按鈕的函數
    function clickClaimButton() {
        const buttons = Array.from(document.querySelectorAll("button, a"));
        const claimButton = buttons.find(btn =>
            btn.textContent.trim().toLowerCase().includes('claim') &&
            !btn.disabled
        );
 
        if (claimButton) {
            claimButton.click();
            console.log('已成功點擊 Claim 按鈕!', claimButton);
        } else {
            console.log('尚未找到可用的 Claim 按鈕,等待...');
        }
    }
 
    // 主函數,定期執行檢查
    function startProcess() {
        console.log('自動點擊腳本已啟動,正在監控 Claim 按鈕...');
        setInterval(() => {
            if (!checkCaptcha()) { // 如果沒有 CAPTCHA,則嘗試點擊 Claim 按鈕
                clickClaimButton();
            }
        }, 10000); // 每10秒執行一次檢查
    }
 
    // 啟動腳本
    startProcess();
})();