Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

109
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda