Skip to content

Delay On Execution

Featured Replies

Hi again, id like to know if theres a way to add some delay between the execution of some lines of code.

 

For example. I've got the mob named X. When i kill the mob named X i want after 20 seconds to spawn automatically the mob named Z. (I've already did the code part for the spawn of Z but idk how to add the delay)

 

Thanks a lot

 

I guess i need to give more infos on how i coded it so the help comes more accurately.

 

 

if(getNpcId()==80209)
{
 
spawn(80210, x, y, z);
}
 
I put this in doDie in RaidbossManager, so when i kill the mob with id 80209 i want to spawn the mob with id 80210

Edited by TheAllKnowing

  • Author

I just used the method Thread.sleep(); will it cause any abnormalties?

sleep sux and can freez even your char. Use ThreadPoolManager.

  • Author

sleep sux and can freez even your char. Use ThreadPoolManager.

Threadpool manager executes 1 time or as a loop? Ive Seen it used mostly for loops with delay on execution

Threadpool manager executes 1 time or as a loop? Ive Seen it used mostly for loops with delay on execution

Threadpool does both depending on the method you are using. It uses singleton pattern to create only one instance of itself with a bunch of threads for you to use in the pool

Once the system is done running whatever you want it to it returns to the pool. It does not run on the main thread to slow you down.

Use script system, you don't need to create any method. It will be enough for 90% of scenarii.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.