Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

268
Visualizações
How do I make a div click without the mouse moving?

I'm trying to make a JavaScript code that injects into cpstest.org and when you click the start button, it automatically starts auto-clicking. I tried to make a script for it, but it just didn't work.

The start button has id start but I don't know the element to click. Viewing source code or using dev tools would be helpful, but those are blocked on my computer.

let i = 1;

document.querySelector('#start').addEventListener('click', function() {
    i = 0;
});

function repeat() {
    if (i == 0) {
        document.querySelector(unknownId).click()}; 
        requestAnimationFrame(repeat)
    }
};

repeat();
about 4 years ago · Santiago Gelvez
1 Respostas
Responde à pergunta

0

Here's a solution:

// speed - how many CPS you want
// duration - how long the test is (in seconds)
const rapidClick = (speed, duration) => {
    const startButton = document.querySelector('button#start');
    const clickArea = document.querySelector('div#clickarea');

    // Start the test
    startButton.click()

    // Click the clickArea on an interval based on the "speed" provided
    const interval = setInterval(() => clickArea.click(), 1e3 / speed);

    // Clear the interval after the duration has passed
    setTimeout(() => clearInterval(interval), duration * 1e3);
}

// Do 100 CPS for 5 seconds
rapidClick(100, 5)

I noticed that even when setting the speed parameter to something insane like 1000 CPS, the test says only 133-139 clicks per second. Seems like it caps off at 139. Hope this helps.

about 4 years ago · Santiago Gelvez Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda