Auto click Claim Button

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

Από την 21/11/2024. Δείτε την τελευταία έκδοση.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

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

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

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.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==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();
})();