Auto Fill Text Captcha (Human-like with Mistakes)

Ketik captcha dengan delay acak + salah ketik sesekali lalu backspace, submit otomatis

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name               Auto Fill Text Captcha (Human-like with Mistakes)
// @namespace          Violentmonkey Scripts
// @version            0.1
// @author             Ojo Ngono
// @description        Ketik captcha dengan delay acak + salah ketik sesekali lalu backspace, submit otomatis
// @match              https://captchacoin.site/*
// @icon               https://i.ibb.co.com/XJSPdz0/large.png
// @license            Copyright OjoNgono
// @grant              none
// @run-at             document-idle
// ==/UserScript==

(function () {
    'use strict';

    function randomDelay(min = 150, max = 400) {
        return Math.floor(Math.random() * (max - min + 1)) + min;
    }

    function typeText(input, text, callback) {
        input.value = "";
        let i = 0;

        function typeNext() {
            if (i < text.length) {
                if (Math.random() < 0.2) {
                    const wrongChar = String.fromCharCode(97 + Math.floor(Math.random() * 26));
                    input.value += wrongChar;

                    setTimeout(() => {
                        input.value = input.value.slice(0, -1);
                        input.value += text[i];
                        i++;
                        setTimeout(typeNext, randomDelay());
                    }, randomDelay(200, 500));

                } else {
                    input.value += text[i];
                    i++;
                    setTimeout(typeNext, randomDelay());
                }
            } else if (callback) {
                callback();
            }
        }

        typeNext();
    }

    function solveCaptcha() {
        const captchaBox = document.querySelector('#cte-captcha-box form div');
        const inputField = document.querySelector('#cte-captcha-form input[name="cte_input"]');
        const submitBtn = document.querySelector('#cte-captcha-form input[type="submit"]');

        if (captchaBox && inputField && submitBtn) {
            const captchaText = captchaBox.innerText.trim();

            if (captchaText.length > 0 && inputField.value !== captchaText) {

                typeText(inputField, captchaText, () => {
                    setTimeout(() => {
                        submitBtn.click();
                    }, 800 + randomDelay(200, 600));
                });
            }
        }
    }

    window.addEventListener('load', () => {
        setTimeout(solveCaptcha, 1500);
    });

    setInterval(solveCaptcha, 5000);
})();