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

102
Vistas
Ways to improve speed of execution of a js bot running in browser console

I have a simple js bot that rapidly answers coding questions in a text area by filling in javascript code and clicking submit button, using a for loop for all solutions I stored in an object:

Here is part of the solutions object:

const solutions = {
  'square': 'return x*x',
  'getType': 'return typeof(x);',
....}

Here is the actual submission and/or for loop:

const get_submit_button = () => document.querySelector('.task-buttons > .col > .btn');
const solve = () => {
  const ace_editor = ace.edit(document.querySelector('.ace_editor'))
  const submission = ace_editor.getValue()
  for (const key in solutions) {
    if (submission.includes('box.' + key + ' ')) {
      ace_editor.insert(solutions[key])
      get_submit_button().click()
      setTimeout(() => {
        get_submit_button().click()
        setTimeout(() => {
          solve()
        }, 400)
      }, 900)
      return
    }
  }
};

solve()

The loop is supposed to answer about 30 questions under 180 seconds. I have tried to reduce time in the setTimeout() function but it usually results in slower execution due to the code (solution being copied) multiple times in the text area.

Is there any way to improve speed of execution or the problem is related to my network speed (2Mb/s)?

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