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.

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.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...