Welcome to the Builder Academy

Question Code execution delay

More
29 Oct 2018 16:25 #8231 by Kinther
Code execution delay was created by Kinther
Hello everyone,

I'm working on trying to find a way to cause a delay to occur so that a specific portion of my code is not run until X seconds later. I want it to simulate the player taking their time to perform the task and not have an instant success/failure, as well as if the player leaves the room that enqueued task will be canceled.

So far I've looked into adding the SCMD_DELAY event noted in www.circlemud.org/pub/CircleMUD/contrib/...ets/utils/events.txt , however it looks like it doesn't support canceling the task if something changes (such as a player leaving the room). This also may have been deprecated in favor of dg_events.

My thought right now is to look over the whirlwind event and get a better idea of how it works, then begin writing the event I want. My question for the board here is if this is the best way to do what I'm trying to do, or if there's an alternate way I've completely missed.

Thanks,

K

4 8 15 16 23 42

Please Log in or Create an account to join the conversation.

More
04 Dec 2018 16:12 #8249 by WhiskyTest
Replied by WhiskyTest on topic Code execution delay
Yes events would be the best way.
The Whirlwind command is a perfect example, use a copy of it as a template and let us know how you get on!

Please Log in or Create an account to join the conversation.

More
06 Dec 2018 17:00 #8258 by Kinther
Replied by Kinther on topic Code execution delay
Thanks WhiskyTest - will play around with this and report back.

4 8 15 16 23 42

Please Log in or Create an account to join the conversation.

Time to create page: 0.334 seconds