-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrestart.js
More file actions
19 lines (18 loc) · 1.1 KB
/
restart.js
File metadata and controls
19 lines (18 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
mc.regConsoleCmd("restart","restart the server",function(){
log("restart the server through 10 second")
setTimeout(() => { mc.broadcast("restart through 10 second"); }, 2000);
setTimeout(() => { mc.broadcast("restart through 9 second"); }, 4000);
setTimeout(() => { mc.broadcast("restart through 8 second"); }, 6000);
setTimeout(() => { mc.broadcast("restart through 7 second"); }, 8000);
setTimeout(() => { mc.broadcast("restart through 6 second"); }, 10000);
setTimeout(() => { mc.broadcast("restart through 5 second"); }, 12000);
setTimeout(() => { mc.broadcast("restart through 4 second"); }, 14000);
setTimeout(() => { mc.broadcast("restart through 3 second"); }, 16000);
setTimeout(() => { mc.broadcast("restart through 2 second"); }, 18000);
setTimeout(() => { mc.broadcast("restart through 1 second"); }, 20000);
setTimeout(() => { mc.broadcast("RESTART!"); }, 21000);
setTimeout(() => { mc.runcmdEx("stop") }, 23000);
})
setInterval(function(){
mc.runcmdEx("restart")
}, 3600000); //the time after which the server will restart (milliseconds)