summaryrefslogtreecommitdiff
path: root/npc/commands/super-menu.txt
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2021-05-06 20:16:57 -0300
committerJesusaves <cpntb1@ymail.com>2021-05-06 20:16:57 -0300
commit8cdc57f0e9b77fe21634eb7e32c3934cd036730d (patch)
treef19b79d84fe66811aee29fcde11b79e69f3d8877 /npc/commands/super-menu.txt
parent238095b40b63fc393520f9014c4bcf036f2365c1 (diff)
downloadserverdata-8cdc57f0e9b77fe21634eb7e32c3934cd036730d.tar.gz
serverdata-8cdc57f0e9b77fe21634eb7e32c3934cd036730d.tar.bz2
serverdata-8cdc57f0e9b77fe21634eb7e32c3934cd036730d.tar.xz
serverdata-8cdc57f0e9b77fe21634eb7e32c3934cd036730d.zip
Add an auto-restart scheduler (external bash scripts)
Diffstat (limited to 'npc/commands/super-menu.txt')
-rw-r--r--npc/commands/super-menu.txt14
1 files changed, 14 insertions, 0 deletions
diff --git a/npc/commands/super-menu.txt b/npc/commands/super-menu.txt
index faddd70d6..bf3923c92 100644
--- a/npc/commands/super-menu.txt
+++ b/npc/commands/super-menu.txt
@@ -210,6 +210,20 @@ OnWed0300:
if (!$AUTORESTART || gettime(GETTIME_DAYOFMONTH) > 7) end;
atcommand("@serverexit 101");
end;
+}
+
+// Auto-restart scheduled
+function script SchedRestart {
+ if (debug && $SCHED_RESTART) {
+
+ if ($SCHED_RESTART == 1)
+ $SCHED_RESTART=gettimetick(2)+900;
+ if ($SCHED_RESTART > gettimetick(2))
+ atcommand("@serverexit 101");
+
+ kamibroadcast("A restart has been scheduled to about %s.", FuzzyTime($SCHED_RESTART));
+ }
+ return;
}