Greasy Fork is available in English.

Simple Nitro Type Auto Typer

UserScript Metadata Block: This block contains metadata about the script, including its name, namespace, version, description, author, and matching URLs.

질문, 리뷰하거나, 이 스크립트를 신고하세요.
// ==UserScript==
// @name         Simple Nitro Type Auto Typer
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  UserScript Metadata Block: This block contains metadata about the script, including its name, namespace, version, description, author, and matching URLs.
//WPM Setting: The wpm variable is set to 120, which determines the typing speed.
//Sleep Function: The sleep function is used to create delays.
//TypeWords Function: This function types each character of the words with a small delay between characters and a larger delay between words based on the WPM.
//GetTypingText Function: This function extracts the typing text from the page.
//StartTyping Function: This function waits for the typing text to appear and then starts the typing process.
//Event Listener: The script starts the typing process when the page loads.

// @author       You
// @match        https://www.nitrotype.com/race
// @grant        none
// ==/UserScript==
(function() {
    'use strict';
    // Set your desired WPM (Words Per Minute)
    const wpm = 120;
    // Function to simulate a delay
    function sleep(ms) {
        return new Promise(resolve => setTimeout(resolve, ms));
    }
    // Function to type the words
    async function typeWords(words) {
        const wordsArray = words.split(' ');
        const delay = (60 / wpm) * 1000; // Delay between words based on WPM
        for (const word of wordsArray) {
            for (const char of word) {
                document.dispatchEvent(new KeyboardEvent('keydown', { key: char }));
                await sleep(50); // Small delay between characters
            }
            document.dispatchEvent(new KeyboardEvent('keydown', { key: ' ' })); // Space after each word
            await sleep(delay); // Delay between words
        }
    }
    // Function to extract the typing text from the page
    function getTypingText() {
        const typingTextElement = document.querySelector('.dash-letter');
        if (typingTextElement) {
            return typingTextElement.innerText;
        }
        return null;
    }
    // Main function to start the typing process
    async function startTyping() {
        let typingText = getTypingText();
        while (!typingText) {
            await sleep(1000); // Wait for the typing text to appear
            typingText = getTypingText();
        }
        await typeWords(typingText);
    }
    // Start the typing process when the race starts
    window.addEventListener('load', startTyping);
})();