Hello. TFS save scripts looks good. But I think they are messy.
Here are two samples I use on my server.
Replace the existing save.lua file:
/data/globalevents/scripts/save.lua
(To choose when this shall auto save enter globalevents.xml and change the time there. (TFS 0.3.6 got 900000 which means 15 minutes).
/save commands for GMs:
/data/talkactions/scripts/save.lua
And your done. I said it was simple.
Additional stuff (optional):
If you are running a real tibia based map or have really long server saves, you might want it to tell when save starts and when its done:
Replace:
with:
Replace the existing save.lua file:
/data/globalevents/scripts/save.lua
LUA:
function onThink()
for var = 1,2 do
if var == 1 then
doSaveServer()
end
if var == 2 then
doBroadcastMessage("Saved.")
end
end
return true
end
/save commands for GMs:
/data/talkactions/scripts/save.lua
LUA:
function onSay(cid, words, param, channel)
if getPlayerGroupId(cid) > 3 then
for var = 1,2 do
if var == 1 then
doBroadcastMessage("Saved.")
end
if var == 2 then
doSaveServer()
end
end
end
return true
end
And your done. I said it was simple.
Additional stuff (optional):
If you are running a real tibia based map or have really long server saves, you might want it to tell when save starts and when its done:
Replace:
LUA:
for var = 1,2 do
if var == 1 then
doBroadcastMessage("Saved.")
end
if var == 2 then
doSaveServer()
end
end
LUA:
for var = 1,3 do
if var == 1 then
doBroadcastMessage("Saving server...") --- this appears before server freeze...
end
if var == 2 then
doSaveServer() --- freeezee....
end
if var == 3 then
doBroadcastMessage("Done.") --- no more lag!
end
end
Last edited: