Jump to content
  • 0

Delay On Execution


Question

Posted (edited)

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

6 answers to this question

Recommended Posts

  • 0
Posted

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
  • 0
Posted

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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..