Skip to content
This repository was archived by the owner on May 1, 2021. It is now read-only.

Commit cae0ba5

Browse files
committed
[restart] Add restart script.
Restart server periodically to clear lag. Only useful for those using MxOpCmd plugin. Mostly a template.
1 parent 775924e commit cae0ba5

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

scripts/management/restart.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/*
2+
Restart server periodically to clear lag. Only useful for those using the MxOpCmd plugin.
3+
Mostly a template / easy starting point for those new to scripting.
4+
5+
v1
6+
*/
7+
8+
const system = server.registerSystem(0, 0);
9+
10+
let i = setInterval(() => {
11+
system.executeCommand(`kick @a Server is restarting to clear lag!`, () => {});
12+
system.executeCommand(`mxopcmd stop`, () => {});
13+
}, 7200)
14+
15+
console.log("restart.js loaded");

0 commit comments

Comments
 (0)