Logging player joins
-
- Burner Inserter
- Posts: 16
- Joined: Sat Aug 06, 2016 9:41 pm
- Contact:
Logging player joins
I'm running a headless Linux server, and I want to write a script that will keep track of who joins the server. Where would I find that information? I only see chat information in the logs.
Re: Logging player joins
You can add some mods to vanilla like scenario.timothy_johnson wrote:I'm running a headless Linux server, and I want to write a script that will keep track of who joins the server. Where would I find that information? I only see chat information in the logs.
Please change what you need.
https://mods.factorio.com/mods/darkfrei/Build-Statistic
-
- Burner Inserter
- Posts: 16
- Joined: Sat Aug 06, 2016 9:41 pm
- Contact:
Re: Logging player joins
Okay, so it's a rewrite/add-on of the control.lua file. Hm. I know bash, I know python, but I don't know lua. I was hoping there was some way to do it without having to learn a new language. Thanks for the pointer, though. I'll look at it some more.
Re: Logging player joins
Learn Lua in 15 Minutestimothy_johnson wrote:Okay, so it's a rewrite/add-on of the control.lua file. Hm. I know bash, I know python, but I don't know lua. I was hoping there was some way to do it without having to learn a new language. Thanks for the pointer, though. I'll look at it some more.
And all events are here http://lua-api.factorio.com/latest/events.html
-
- Burner Inserter
- Posts: 16
- Joined: Sat Aug 06, 2016 9:41 pm
- Contact:
Re: Logging player joins
These links answer all my questions. You're my new favorite person.
Re: Logging player joins
https://www.youtube.com/watch?v=S4eNl1rA1Ns It says 1 hour but after 30 minutes you will know everything lua has to offer
It is a quick language to pick up.
basically in control.lua (of a mod or scenario file)
It is a quick language to pick up.
basically in control.lua (of a mod or scenario file)
Code: Select all
script.on_event(defines.events.on_player_joined_game, function(event)
game.write_file("PlayerJoins.txt", game.players[event.player_index].name.."\n", true) --Create a file in script_output directory with the joined players name and a carriage return. Append to file = true
end)
Re: Logging player joins
Timestamp http://lua-api.factorio.com/latest/LuaG ... cript.tick
"Save to" settings http://lua-api.factorio.com/latest/LuaG ... write_file
"Save to" settings http://lua-api.factorio.com/latest/LuaG ... write_file
It was very difficult to start modding for me too. All tutorials are very old and can't explain what's going on in code.These links answer all my questions.