Create a TF2 server
TF2 is a fun game I’d like people to play on. Unfortunately, it’s not as easy to set up a TF2 server (compared to, IE, a minecraft server), but I did the work for you with this tutorial :).
Continue readingTF2 is a fun game I’d like people to play on. Unfortunately, it’s not as easy to set up a TF2 server (compared to, IE, a minecraft server), but I did the work for you with this tutorial :).
Continue readingThis article is a step-by-step tutorial on how to install DuckHunt, and the support server bot, DuckHunt Community. If you want to help developing the bot, this tutorial is the official way to setup your developpement environnemnt
Let’s start by a recap of what DuckHunt (DH), and DuckHunt-Community (DHC) is.
DuckHunt is a discord game bot, created following MenzAgitat own DuckHunt IRC bot. The primary goal of the game is to kill ducks. To make the game more fun and entertaining, a big number of commands, shop items, special ducks, have been added since the first version.
Of course, hosting a big game across so many discord servers (guilds) require a great support team. The support is provided, on the official DuckHunt Support Server. To help with moderating the previous server, a custom bot has been developed : DuckHunt-Community
Both bots use the latest version of python on discord.py at the time of writing, respectively 3.6 and the rewrite branch.
The game has been open-sourced on GitHub.
If you don’t want to install DuckHunt, but just want to use it, you are in the wrong place. An up-to-date website with the command list, the settings, usage, FAQs, and the installation tutorial to get the official bot on your server are available on the Bot Website
If you want to proceed with the bot installation, you’ll need :
Additionally, the configuration used in this tutorial is as follow.
Feel free to change this configuration if needed, but you may need to adapt some parts of the tutorial.
We’ll start by installing dependencies to both bots, then we will fully install DuckHunt, and to finish things up DuckHunt Commmunity
Let’s connect to our new server using
ssh root@§§server_IP§§
Now, let’s get the system up-to-date and install dependencies:
apt update
apt upgrade -y
apt install -y apt-utils git htop screen apache2 php php-mysql python3-pip python3-dev mysql-client mysql-server libmysqlclient-dev
Create the DuckHunt User
adduser duckhunt
And provide a password if asked.
Download the code of both bots in the specified directories.
su - duckhunt
git clone https://github.com/DuckHunt-discord/DHV3.git §§DH_installation_folder§§
git clone https://github.com/DuckHunt-discord/DuckHunt-Community-Rewrite.git §§DHC_installation_folder§§
exit
Let’s install python requirements for DuckHunt
cd §§DH_installation_folder§§
pip3 install -r requirements.txt
Time have come to create the database for DuckHunt.
Login as the root user on the DataBase:
mysql -u root -proot
In the MySQL prompt, to create the user and the database, write
create database §§DH_mysql_db_name§§;
grant all privileges on §§DH_mysql_db_name§§.* to '§§DH_mysql_db_user§§'@'localhost' identified by "§§DH_mysql_db_password§§";
flush privileges;
exit;
Then, load the schema into the database.
mysql --database=§§DH_mysql_db_name§§ -u §§DH_mysql_db_user§§ -p§§DH_mysql_db_password§§ < §§DH_installation_folder§§/schema.sql
Now that the database is correctly setup, give the bot the credentials to connect to discord.
For this, create a credentials.json
file using
nano §§DH_installation_folder§§/credentials.json
In this file, add the following :
{
"token": "§§DH_token§§",
"bots_discord_pw_key" : "",
"discordbots_org_key" : ""
}
Then, save and quit (CTRL-X + Y).
Open the configuration file with
nano §§DH_installation_folder§§/cogs/helpers/config.py
At least, locate the lines concerning the database settings and update them to look like this:
# > Database settings < #
# User used to connect to the Mysql DB
bot.database_user = "§§DH_mysql_db_user§§"
# Password for the user used to connect to the Mysql DB
bot.database_password = "§§DH_mysql_db_password§§"
# Name of the table used in the Mysql DB
bot.database_name = "§§DH_mysql_db_name§§"
Of course, you can update other settings there.
Then, save and exit (CTRL-X + Y).
DuckHunt should now be working \o/. To test and start it, type
cd §§DH_installation_folder§§ && python3 ./bot.py
Let’s start by configuring the DB for it :
nano §§DH_installation_folder§§/web/duckstats.php
Locate the lines like this and replace them:
$dbname = "§§DH_mysql_db_name§§";
$username = "§§DH_mysql_db_user§§";
$password = "§§DH_mysql_db_password§§";
You can also change the server name in web/live-ducks.php
if needed
A simple symlink should do the trick to serve it:
rm -Rv /var/www/html
ln -s §§DH_installation_folder§§/web /var/www/html
Finally, to save the data from the stats API periodically, open the crontab
su - duckhunt
crontab -e
Add the following :
0 * * * * cd §§DH_installation_folder§§/web ; python3 ./save_historical_to_csv.py
Exit nano as usual, and type exit
to return to the root prompt
DuckHunt Community should be really easier to install, since we don’t require a database for it.
To let DuckHunt-Community store data about bans and stuff, we’ll need the following directory structure.
mkdir §§DHC_installation_folder§§/mods
mkdir §§DHC_installation_folder§§/mods/cases
mkdir §§DHC_installation_folder§§/mods/users
echo '1' > §§DHC_installation_folder§§/mods/current_case.txt
mkdir §§DHC_installation_folder§§/users
Again, give the bot the credentials to connect to discord.
For this, create a credentials.json
file using
nano §§DHC_installation_folder§§/credentials.json
In this file, add the following :
{
"token": "§§DHC_token§§"
}
You’ll probably want the bot to restart every time it fails, or when you use the dhexit
command. Feel free to use this tutorial for this.
This article is a step-by-step tutorial on how to install a fork of DuckEnigma, and create some questions. Let’s start by a recap of what DuckEnigma is.
Continue readingTo display a traceroute graphically on a map, it is possible to use the excellent traceroute mapper by pasting the output of the traceroute command to it, but it is also possible to use the following command to open the web page directly from the terminal.
Continue reading