Have a chat with SRB2 players on Discord!
This is based off of Sirexer's SRB2 Discord Bot. You will need Python 3+ and the required modules for the bot.
The script does not work on Linux. This is also not tested for SRB2Kart.
Python modules:
- Discord 1.7.3;
- Tkinter 0.1.0;
- Colorama 0.4.6;
- C data types 1.1.0;
- Transliterate 1.10.2;
- Regular Expression Engine 2.2.1;
- JavaScript Object Notation 2.0.9.
What the bot is able to do:
- Relay chat from the game into a Discord channel, and let Discord users communicate back in that channel;
- Run the server with parameters, the parameters are specified in the .cfg file;
- Restart the server with a fatal error or at closing the server;
- Display server statistics (map, image (url), map number, number of emeralds, number of players, map time, server time, list of players and their statistics).
- Display messages in the console with timecodes;
- write log messages from the game and from Discord in the log file;
- Returns the current map after server restart;
- Save game logs in another folder (because of an auto restart, logs are not saved in the logs folder);
- Execute commands such as: csay, kick, ban, map, exitlevel, restart in Discord;
- Autorestart on the desired map or through the number of completed levels, changes parameters if this is configured in the autorestart.cfg;
- Pause the server if there are no players on the server.
SRB2 command table
Name | Description | Possible Value | Default Value |
---|---|---|---|
dbot_joinquit | Notifies in Discord if a player joins or leaves the game for any reason. | CV_OnOff | On |
dbot_autopause | Pauses the game if the server has no players. | CV_OnOff | On |
dbot_nospamchat | Puts Calmdown on second for messages. | CV_OnOff | Off |
dbot_messagedelay | Delays messages and sends messages after two seconds. | CV_OnOff | On |
CFG files
- autorestart.cfg - configures autorestart and when to change server parameters;
- commandperms.cfg - configures command permissions;
- config.cfg - it contains the token and other standard settings;
- dontsavemap.cfg - ignores the return of levels on maps in the file the next time you start the server;
- emotes.cfg - configures emoji for information channel;
- serverparameters\parameters.cfg - parameters for the server, they will not change, unless you edit the file;
- serverparameters\pcfg<X>.cfg - parameters for the server, if you have configured restart they will change.
Video Guide - https://youtu.be/ZiKhOHKt_xk