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

111
Visualizações
p5.js autoclicker calling

I have a simple question maybe, I was for days looking for solution and don't want to waste your time, but isn't work for me so I'm here now.

Im using P5JS, and I wanted to create auto click function. There how I call an button in sketch.js file

 var button1 = createButton("Generator");
  button1.mousePressed(banana);
  button1.id('autoclick');

Here you can see how I call in index.html Im trying something like this:

    <script type="text/javascript">
var iteration = true;
var time = new Date();
var delay = 5000; // 5 secondes

while(iteration) {
    if(time.getTime() + 5000 < new Date().getTime()) {
         iteration = false;
    }
}
document.getElementByID('autoclick').click();
      // noprotect
</script>

Maybe I complicate to much? any suggetions? thank you!

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Your while loop is blocking, which means that while Javascript is running your while loop, it will not be able to execute any other code. You want to use setInterval() for your purposes.

For example,

setInterval(() => console.log("hello!"), 1000)

about 4 years ago · Juan Pablo Isaza 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