Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

304
Views
No puedo detener mi intervalo y tampoco funciona clearInterval();

Hice un script de usuario simple para el juego https://zty.pe/ , el bot funciona en mi versión modificada del juego, intento hacerlo cada vez que hago clic en "F", comienza a ejecutarse, pero se detiene cuando haga clic en "C", el ciclo funciona normalmente después de hacer clic en C y no se detiene.

 document.addEventListener('keydown', (e) => { key = e.keyCode if(key == 70){ var zTypeBotAlphaChars = "abcdefghijklmnopqrstuvwxyz"; var zTypeBotCharToType = 0; ztypebot = setInterval(function() { ig.game.shoot( zTypeBotAlphaChars.charAt(zTypeBotCharToType)); } , 10); } }) document.addEventListener('keydown', (e) => { if(e.keyCode == 67){ clearInterval(ztypebot, 10); } })
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Intenta agregar window. antes del intervalo ztypebot para convertirlo en una función global:

 document.addEventListener('keydown', (e) => { key = e.keyCode if(key == 70){ var zTypeBotAlphaChars = "abcdefghijklmnopqrstuvwxyz"; var zTypeBotCharToType = 0; window.ztypebot = setInterval(function() { ig.game.shoot( zTypeBotAlphaChars.charAt(zTypeBotCharToType)); } , 10); } }) document.addEventListener('keydown', (e) => { if(e.keyCode == 67){ clearInterval(window.ztypebot, 10); } })
about 4 years ago · Juan Pablo Isaza Report

0

Su variable ztypebot es local en cada función, debe definirla fuera de esta manera:

 let ztypebot; document.addEventListener('keydown', (e) => { ... ztypebot = setInterval(function() { ... } }) document.addEventListener('keydown', (e) => { if(e.keyCode == 67){ clearInterval(ztypebot, 10); } })
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!