create_actor

Started by habi, Apr 28, 2020, 08:04 PM

Previous topic - Next topic

habi

#30
Quote from: MEGAMIND on May 05, 2020, 12:50 PMif the bots loops by itself let me know how.....

have you tried something like (in play.js line 50 )
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/
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.
var interval =setInterval(function () {..... .
.....   }, properties.packets.intervalSpeed);
in a while loop
while ( true) {

sleep( 5000 );
}