7DTD-ScriptingMod
7DTD-ScriptingMod copied to clipboard
Run scripts periodically by configurable timers
It should be possible to run scripts repeatedly based on timers, similar to a cronjob.
Is setimout or setinterval not available in the js runtime?
No, because this is part of the window object, which does not exist without browser. I might add these two methods later, but it would still require someone to execute a command initially, after every server restart.
It is also problematic to have long-running scripts, because commands are executed on the main thread and freeze the server while executing. Adding the possibility to delay execution with settimeout is not trivial.