Nitro Type Auto Typer

Auto typer for Nitro Type with 150 WPM and 100% accuracy

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği yüklemek için Tampermonkey gibi bir uzantı yüklemeniz gerekir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği indirebilmeniz için ayrıca Tampermonkey gibi bir eklenti kurmanız gerekmektedir.

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

Bu stili yüklemek için Stylus gibi bir uzantı yüklemeniz gerekir.

Bu stili yüklemek için Stylus gibi bir uzantı kurmanız gerekir.

Bu stili yükleyebilmek için Stylus gibi bir uzantı yüklemeniz gerekir.

Bu stili yüklemek için bir kullanıcı stili yöneticisi uzantısı yüklemeniz gerekir.

Bu stili yüklemek için bir kullanıcı stili yöneticisi uzantısı kurmanız gerekir.

Bu stili yükleyebilmek için bir kullanıcı stili yöneticisi uzantısı yüklemeniz gerekir.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name         Nitro Type Auto Typer
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Auto typer for Nitro Type with 150 WPM and 100% accuracy
// @author       Benjamin Herasme
// @match        *://www.nitrotype.com/*
// @license      MIT
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Function to simulate typing
    function typeText(text) {
        let index = 0;
        const interval = 1000 / 150; // 150 WPM means 1000 ms per 150 words, so ~6.67 ms per character
        const typeInterval = setInterval(() => {
            if (index < text.length) {
                const inputField = document.querySelector('.race-input');
                if (inputField) {
                    inputField.value += text.charAt(index);
                    index++;
                } else {
                    clearInterval(typeInterval);
                }
            } else {
                clearInterval(typeInterval);
            }
        }, interval);
    }

    // Function to start the auto typer
    function startAutoTyper() {
        const raceText = document.querySelector('.race-text').innerText;
        typeText(raceText);
    }

    // Wait for the race to start and then start typing
    const observer = new MutationObserver((mutations) => {
        for (const mutation of mutations) {
            if (mutation.type === 'childList' && mutation.addedNodes.length > 0) {
                const raceText = document.querySelector('.race-text');
                if (raceText) {
                    startAutoTyper();
                    observer.disconnect();
                }
            }
        }
    });

    observer.observe(document.body, { childList: true, subtree: true });
})();