« [Client Side] Sending data + DecUI
create_actor

habi

  • Sr. Member
  • Posts: 287
Re: create_actor
« Reply #30,  »Last edited
Quote from MEGAMIND on May 5th, 2020, 01:50 PM
if the bots loops by itself let me know how.....
have you tried something like (in play.js line 50 )
Code: [Select]
if(properties.packets.counter > (properties.packets.total - 1)) {
  properties.packets.counter = 0;
  properties.packets.replacedName = false;
 }

Then sleep for sometime. this is a sleep function from https://www.sitepoint.com/delay-sleep-pause-wait/
Code: [Select]
function sleep(milliseconds) {
  const date = Date.now();
  let currentDate = null;
  do {
    currentDate = Date.now();
  } while (currentDate - date < milliseconds);
}
sleep( 5000 ); //5 sec sleep

Then insert all lines from 47  to 87 ie.
Code: [Select]
var interval =setInterval(function () {..... .
.....   }, properties.packets.intervalSpeed);
in a while loop
Code: [Select]
while ( true) {

sleep( 5000 );
}

« [Client Side] Sending data + DecUI