I would like to have a script that saves every 2 or so hours like on many OT servers,but, I would also like o have a weekly globalsave that restarts the server to load any bug fixes and new stuff.
Is this possible?
I have this save script ruining but I never see a save or a broadcast, so something may be wrong with it.
Register in globalevents:
Script:
I also have a clean but I think this is also broken.
Script:
Register in globalevents:
Thanks!
Is this possible?
I have this save script ruining but I never see a save or a broadcast, so something may be wrong with it.
Register in globalevents:
Code:
<globalevent name="save" interval="1400000" event="script" value="save.lua"/>
Script:
Code:
local config = {
broadcast = "yes"
}
config.broadcast = getBooleanFromString(config.broadcast)
local function executeSave(seconds)
if(seconds == 0) then
doSaveServer()
return true
end
if(seconds == 120 or seconds == 30) then
doBroadcastMessage("Full server save within " .. seconds .. " seconds, please stay in safe place!")
end
seconds = seconds - 30
if(seconds >= 0) then
addEvent(executeSave, 30 * 1000, seconds)
end
end
function onThink(interval, lastExecution, thinkInterval)
if(not config.broadcast) then
doSaveServer()
return true
end
executeSave(120)
return true
end
I also have a clean but I think this is also broken.
Script:
Code:
function executeClean()
doCleanMap()
doBroadcastMessage("Clean done. Next clean in 2 hours.")
return true
end
function onThink(interval)
doBroadcastMessage("Cleanup in 30 seconds, pick up your stuff!")
addEvent(executeClean, 40000)
return true
end
Register in globalevents:
Code:
<globalevent name="clean" interval="7200000" event="script" value="clean.lua"/>
Thanks!