#Javascript problem

4 messages · Page 1 of 1 (latest)

solemn moss
#

I have a problem, im trying to create a script with chatGPTs help; im not really used to programming tho; i've managed to reach the point i am almost obtaining what ai want but i cant fully do it right;

In a website that you can learn to type fast; "https://www.typingstudy.com/ca-catalan-2/typingtest/6373/Germans_Livonians_de_lEspasa"

I want to use a script in developer tools console that lets me write word by word and progress in all the lessons;

I can write at like 98wpm and making these texts makes it soooo boring for me, instead of wasting 1h typing 20 lessons i rather prefer investing 20h on learning how to do it without doing it;

// Seleccionar los elementos necesarios
const textarea = document.querySelector('textarea');
const span = document.querySelector('span.next_txt');

// Obtener el texto a escribir y dividirlo en palabras
const words = span.textContent.split(' ');

// Escribir palabra por palabra
let index = 0;
const interval = setInterval(() => {
  // Si se han escrito todas las palabras, detener el intervalo
  if (index === words.length) {
    clearInterval(interval);
    return;
  }

  // Escribir la siguiente palabra y avanzar el índice
  textarea.value += words[index] + ' ';
  index++;

  // Disparar un evento de input para que la página detecte el texto escrito
  const event = new Event('input', { bubbles: true });
  textarea.dispatchEvent(event);
}, 1000 / 60); // Velocidad de 60 ppm```
marsh horizon
#

Sooo, you want to cheat on a site that's supposed to teach you how to type quicker?

solemn moss
#

I type faster enough, but writting those texts is boring af; i can write around 95-100 wpm with 96% accuracy

#

i didnt sign for that class but i have to do it anyway