Auto Click "I'm not a robot"

Automatically clicks the "I'm not a robot" checkbox and Solves CloudFlare Turnstile

当前为 2024-05-20 提交的版本,查看 最新版本

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

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

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Auto Click "I'm not a robot"
// @namespace    http://tampermonkey.net/
// @version      0.5
// @description  Automatically clicks the "I'm not a robot" checkbox and Solves CloudFlare Turnstile
// @author       JJJ
// @match        *://*/*
// @icon         https://pngimg.com/uploads/robot/robot_PNG96.png
// @grant        none
// @license      MIT
// ==/UserScript==

(function () {
    'use strict';

    // Define the delay between clicks (in milliseconds)
    const delayBetweenClicks = 100;

    // Define the sleep function that pauses the script for a specified amount of time
    function sleep(ms) {
        return new Promise(resolve => setTimeout(resolve, ms));
    }

    // Define the clickRecaptchaCheckbox function that attempts to find and click the reCAPTCHA checkbox
    async function clickRecaptchaCheckbox() {
        const recaptchaCheckboxElement = findRecaptchaCheckboxElement();
        if (recaptchaCheckboxElement) {
            recaptchaCheckboxElement.click();
            await sleep(delayBetweenClicks);
        }
    }

    // Define the findRecaptchaCheckboxElement function that searches for the reCAPTCHA checkbox using the DOM
    function findRecaptchaCheckboxElement() {
        const recaptchaTextElements = document.querySelectorAll('*:not(script):not(style)');
        for (const element of recaptchaTextElements) {
            if (element.textContent.includes("I'm not a robot")) {
                return element;
            }
        }

        const recaptchaCheckboxElements = document.querySelectorAll('.recaptcha-checkbox');
        for (const element of recaptchaCheckboxElements) {
            return element;
        }

        return null;
    }

    // Call the clickRecaptchaCheckbox function periodically
    setInterval(clickRecaptchaCheckbox, 200);

    // Solve CloudFlare Turnstile
    (function () {
        'use strict';
        setInterval(function () {
            document.querySelector('#challenge-stage')?.querySelectorAll('*')?.forEach(element => {
                element.click();
            });
        }, 1500);
    })();
})();