Download here.
Basic usage: drag BaroBot.py, BaroBotRanks.txt, and BaroBotInit.txt into the same directory as BarotraumaServer.exe, edit BaroBotRanks.txt and BaroBotInit.txt to your liking, and run BaroBot.py. It should automatically start up the server (An empty black console will appear, that's expected and as far as I can tell unavoidable). Console output will appear in whatever shell you ran python in. To use in-game commands, type !<command> <arguments>, and BaroBot should handle it for you.
Spoiler
BaroBot prevents server owners from typing console commands into the server directly, which seems to be unavoidable. However, BaroBot IS capable of automatically promoting certain IP addresses. You can use this to appoint moderators and admins, including yourself. This does not grant access to all of the commands, however.Commands in BaroBotInit.txt will be ran on server startup; this is good for setting the server name. BaroBotInit.txt should have one command per line, and the last line should be "END". This is to prevent some weird things with newlines. Failure to do so may cause issues.
Staff listings in BaroBotRanks.txt are of the format [IP Address]:[Rank]. [Rank] should be a rank found in Data/permissionpresets.xml; by default these are Admin and Moderator. By default, it'll automatically promote 127.0.0.1, the localhost, to Admin. In layman's terms, if you connect on the computer running BaroBot, it'll give you admin powers automatically.
You're all free to do with this code as you wish, including re-releasing it, modifying it, etc. I'd appreciate it if you put a link back here though.
Current BaroBot commands are:
!submarine <sub name>: Sets the submarine for the next round to <sub name>
!shuttle <shuttle name>: Sets the respawn shuttle for the next round to <shuttle name>
!gamemode <gm>: Sets the gamemode for the next round to <gm>
!start: Starts the game
!help: Gives a short help message about how to use BaroBot
WARNING: I don't think there's any way to perform shell injections with BaroBot, but I'm not an expert here. I kludged it together in about 2 hours, there may be big security holes. You've been warned. Additionally, it's possible the program will deadlock your computer. Again, I don't think it'll happen--but you've been warned.