Posted July 3, 20178 yr Good evening! I tried to implement scheduled(delayed) tasks in my code and now every few seconds I get this message in terminal. I am using eclipse. The scheduled task seems to work fine I am just scared that this mod won't make too much for people using it. If anyone could figure out Initializing(if this is correct term) the timer: private final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1); The delayed function: void DelayedTask() { //flag=false; System.out.println("CHECK1"); if(DntbMod.DoQuests) { m.thePlayer.sendChatMessage(GetGame()); } else{m.thePlayer.sendChatMessage(DntbMod.komanda);} } Calling the delayed function: sleep= 3000+(long)(Math.random()*5000); scheduler.schedule(new Runnable() {public void run() { DelayedTask(); }}, sleep, MILLISECONDS); Thank you for your help. Erol
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.