Greasy Fork 还支持 简体中文。

Nitro Type Auto Typer

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

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