• 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!

TalkAction /restart

Win:
Code:
doSaveServer()
os.execute("tskill theforgottenserver") -- die TFS, and what now? nothing... does not works :)
os.execute("start path/to/tfs.exe")

Linux:
Code:
doSaveServer()
os.execute("killall `theforgottenserver`") -- die TFS, and what now? nothing... does not works :)
os.execute("/path/to/theforgottenserver")

Instead of using restarter :d

:( :(
 
If anyone of you get the error "nil value savePlayers()" or somehow your players and data isnt saved, then replace savePlayers() with saveData() in restarter.lua. :)
Also make sure you have named your server exaktly TheForgottenServer without any spaces.
 
Win:
Code:
doSaveServer()
os.execute("tskill theforgottenserver")
os.execute("start path/to/tfs.exe")

Linux:
Code:
doSaveServer()
os.execute("killall `theforgottenserver`")
os.execute("/path/to/theforgottenserver")

Instead of using restarter :d

will never work!
and that's because the server will shutdown before it can execute that final line, so it will not work, but you can make it execute a shell script and inside the shell script you can have it close the server and then run it.
 
this doesnt work anymore :(

i use TFS 0.2.14

error message
[17/03/2013 20:48:20] Lua Script Error: [TalkAction Interface]
[17/03/2013 20:48:20] in a timer event called from:
[17/03/2013 20:48:20] data/talkactions/scripts/restarter.lua:eek:nSay
[17/03/2013 20:48:20] data/talkactions/scripts/restarter.lua:52: attempt to call global 'savePlayers' (a nil value)
[17/03/2013 20:48:20] stack traceback:
[17/03/2013 20:48:20] [C]: in function 'savePlayers'
[17/03/2013 20:48:20] data/talkactions/scripts/restarter.lua:52: in function <data/talkactions/scripts/restarter.lua:36>

after countdown
 
error in engine. tfs 0.3.6pl1

3now4c.jpg
 
If you use linux you can restart the server using /shutdown # :p
Dear, this command i need to use in game or inside linux, i mean cause i work on putty, but for example if i make a modification i need to shutdown the server either from game or putty , but don't want to use killall since it kill all the process and after it restarts i get errors on players_online,

The solution for me is to shutdown the server in game or putty. then the autorestarte.sh will come and everything will be ok

Now i have server save at 1:00 am, it saves, shutdown, and then .sh uploads it again.

i just need a command on putty or in game to shutdown the server. without using killall in putty (linux)
 
Dear, this command i need to use in game or inside linux, i mean cause i work on putty, but for example if i make a modification i need to shutdown the server either from game or putty , but don't want to use killall since it kill all the process and after it restarts i get errors on players_online,

The solution for me is to shutdown the server in game or putty. then the autorestarte.sh will come and everything will be ok

Now i have server save at 1:00 am, it saves, shutdown, and then .sh uploads it again.

i just need a command on putty or in game to shutdown the server. without using killall in putty (linux)

What server version are you using?
 
Use "/closeserver shutdown" from within the game on a god char and the server will save and shut down. You can later restart it in putty.
Is that okay if i just have in my talk actions the following??

<talkaction words="/closeserver" separator=" " script="closeserver.lua" />
 
Use "/closeserver shutdown" from within the game on a god char and the server will save and shut down. You can later restart it in putty.
Now i got it, on lua says if param== shutdown,

perfect, one last question, once it starts again i need to /openserver?
 
Back
Top