Command to write a list of all players in your game to file

Arrange meetings with other people to play MP, announce your servers.
iggyboo
Burner Inserter
Burner Inserter
Posts: 9
Joined: Sun Sep 11, 2016 2:20 am
Contact:

Command to write a list of all players in your game to file

Post by iggyboo »

I just hacked this out for to get a list of all players that logged into your game to a file. You can run this in the console with the game running or on a file you load after the fact:

`
/c names="Names: "; for _, p in pairs(game.players) do names=names..p.name..", " end; game.write_file("playerlist.txt",names)

That will output a file named "playerlist.txt" to the <USER>\Factorio\Script-Output folder (under AppData for Windows)

I searched around and couldn't find it in the forums, so I figured I'd post it here for future reference.
Post Reply

Return to “Multiplayer”