-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathglobal-save.xml
40 lines (34 loc) · 1.37 KB
/
global-save.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?xml version="1.0" encoding="UTF-8"?>
<mod name="global-save" version="1.0" author="slawkens" contact="[email protected]" enabled="yes">
<description><![CDATA[
Basically, this script does same thing like "globalSaveEnabled" in TFS
with addition that this one can be configured to make few global saves per day (unlimited amount)
plus, this one is written as a lua script, so you can modify it easier
WARNING: it works only with shutdown option
** Scroll down to add your own saves! **
]]></description>
<config name="global-save-lib"><![CDATA[
local shutdownEvent = 0
function prepareShutdown(minutes)
if(minutes <= 0) then
doSetGameState(GAMESTATE_SHUTDOWN)
return false
end
if(minutes == 1) then
doBroadcastMessage("Server is going down in " .. minutes .. " minute, please log out now!")
elseif(minutes <= 3) then
doBroadcastMessage("Server is going down in " .. minutes .. " minutes, please log out.")
else
doBroadcastMessage("Server is going down in " .. minutes .. " minutes.")
end
shutdownEvent = addEvent(prepareShutdown, 60000, minutes - 1)
return true
end
]]></config>
<!-- to do more saves per day just copy this part -->
<globalevent name="global-save-event" time="05:55:00" event="buffer"><![CDATA[
domodlib('global-save-lib')
prepareShutdown(5) -- in 5 minutes
_result = true
]]></globalevent>
</mod>