Advertisement
Guest User

Untitled

a guest
Apr 20th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function restartAutos2() {
  2.   $('#restartautosbutton').attr('value', 'Restarting...').attr('disabled', 'true');
  3.   $.post('actions.php', {mod:'restartautos'}, function(data) {
  4.     if(data.sc) {
  5.       securityCheck(data.v);
  6.       setTimeout(submitSecurityCheck, Math.round(604 + (Math.random()*1000)));
  7.       console.log('SECURITY CHECKK');
  8.     } else {
  9.       $('#restartautosbutton').attr('value', 'Autos Restarted');
  10.       var displayAutos = displayAutosRemaining(data.autos, data.fatigue);
  11.       $('#autos-remaining').html(displayAutos);
  12.     }
  13.   }, 'json');
  14. }
  15.  
  16.  
  17. function loop() {
  18.   let rand_base = Math.round(Math.random() * 550000);
  19.   let rand = rand_base + Math.round(Math.random() * 3000);
  20.   console.log('rand: ', rand);
  21.   setTimeout(function() {
  22.     restartAutos2();
  23.     loop();
  24.   }, rand);
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement