BaroBot - Quick and dirty configuration bot

#1
So, while setting up a small, private server for friends, I quickly got frustrated at having to appoint admins to set up pre-round stuff, like submarine or gamemode selection. Being a programmer with nothing better to do, I wrote up a python bot to handle it for me, via chat commands. I figure this might be something others would like to have. This should be fully compatible with vanilla, BTE, and any other content packs.

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
Download BaroBot, open the .rar file, and move all three files inside into the same place as your BarotraumaServer.exe file.
Adjust the .txt files to your liking, as described in the rest of the post. The only thing you really need to change is in BaroBotInit.txt; change "Default BaroBot Server" to the server name you want.
Download this.
Run it, go through the steps without changing the options, let it do its thing.
Use your computer's search function to find the program called "IDLE", and run it.
Press the File button at the top left, click on "Open...", and find BaroBot.py, one of the files you took out of the .rar earlier. Make sure you look in the folder with BarotraumaServer.exe, instead of trying to look in the .rar file.
In the new window that appears, click on the Run button a little to the right of File, and click on "Run Module."
A new black window should open, and a bunch of text will appear on one of the IDLE windows. Congratulations, you're now the proud owner of a BaroBot server.
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.
cron