Jump to content
  • 0

Most performant way of making periodic events


IVeve

Question

Hi, I'm trying to make a global event that happens every 2 hours. What is the most efficient way of doing this? I had the thought of running an autorun event with a wait command of 2 hours, but I'm not sure what sort of load that puts on the server.

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 1

You wouldn't directly CALL the common event.

 

Basically, you'd want to have a common event that triggers off of changing a variable to do what you need to do.

Then in your API script you change that variable every time you want to trigger the common event.

Link to comment
Share on other sites

  • 0

In all honesty, I would suggest leveraging the API for timed stuff.

The wait timer is unreliable as it resets every time the server restarts. (So one day it could trigger at 2:00 and the next day at 3:12 because of a restart)

 

You could have it trigger based on a variable changing, and use the API to change said variable on a set two hour timer through an external call.

This will always be timed correctly because an external source other than the server is keeping track.

You also wouldn't be telling the server to keep an event active and checking for the wait timer constantly.

Link to comment
Share on other sites

×
×
  • Create New...