Command to write a list of all players in your game to file
Posted: Fri Sep 23, 2016 2:32 am
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.
`
/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.