• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Add an Auto Save to Avesta 7.6.. ?

RealSoft

Banned User
Joined
Feb 3, 2009
Messages
4,381
Reaction score
92
Location
There I sleep
As Title.. how do I do it, add a Save that save etc 5 min (players/houses)..


I've been trying to find the codes but without any success <.<

Rep++ For the one that help me with that annoying problem :P

Edit for those can't understand -.-:


When I close the server, I must make /save, else houses will reset.. same thing if the server would crash..

that I want, is a script or what ever, which will make automatically saves each 5-10 minutes or what ever.

How do I create that?...
 
Last edited:
bumping this thread because i have this problem to.. and to reply to the last post..i dont know it, would you mind telling me how to get it working :S

i just need avesta to autosave every X minutes.

thnx ~jaroen
 
A talkaction that loops between different intervals right?..

Just give me the avestas version so I can update myself with the functions etc.. and I'll try to do it..
 
Try writing a LUA script with "save()" or whatever command is used to save the server, and have it execute everytime someone logs out or logs in.

Or if possible, like mentioned above, write a looping command with a sleep() or wait() that executes once every 5 minutes.
 
I have a server save function in my avesta, I'll rip it out tomorrow and post it here. Code is created by Kratos by the way
 
In void Game::saveServer()
Under saveGameState();
Add:

Code:
Scheduler::getScheduler().addEvent(createSchedulerTask(g_config.getNumber(ConfigManager::SERVER_SAVE_INTERVAL) * 60000, boost::bind(&Game::saveServer, this)));

If it hasn't already been declared in game.h, declare it.

Add this somewhere under public

Code:
void saveServer();

(Remember, it might already have been declared.)

Somewhere in configmanager.cpp (with the others)
add:

Code:
m_confInteger[SERVER_SAVE_INTERVAL] = getGlobalNumber(L, "serversave", 10);

declare with the other CONFIGINTEGER
under TEMPLE_TP_ID,
add:

Code:
SERVER_SAVE_INTERVAL,

And in config.lua:

LUA:
    -- auto server save by kratos, the server will save its gamestate every x minutes (10 = standard)	
    serversave = 10
 
As he said, make an event script that does the command /save every 30 min or so one, or use the config as save time :D idk if you use tfs 7.6:P
 
Back
Top