This project has been designed to help people who do not know how to code to be able to host a room with multiple options.
This is a new version, which capitalizes on the latest Haxball update that notably introduced the noPlayer
option.
The files of the last version are still accessible, along with the README file in the OLD folder. Their use is discouraged.
Download the project or the script you want to use on your computer.
For editing the code, I highly recommand the use of Visual Studio Code as it is a very complete IDE. You will need it to change the room options.
The options are at the top of the code, and they are numerous. For example, you can set the name of the room, add a headless token, change the default stadiums, edit the team size for the public room, etc.
- Open the Haxball headless page
- Open devtools using F12 and select the console
- Copy and paste the content of the script of your choice
- If you haven't added a headless token from the token page, complete the captcha
- The room is now open, press Ctrl + Click to open it (keep the headless room tab open)
My recommandation for when you are using a server is to use Ubuntu 18.04 as it is both cheaper and more powerful for hosting rooms. If you are not familiar with Linux, you can always use Windows and the same method as for a local machine. For Ubuntu, use the following method:
- Install haxroomie by entering in the terminal:
bash <(curl -s https://raw.githubusercontent.com/morko/haxroomie/master/scripts/install-haxroomie-cli-debian.sh)
Keep the default options and enter a password when prompted
-
Run haxroomie once by entering haxroomie in the terminal and immediately exit by pressing
q
-
Upload your script to the VPS, and remember its path
-
Enter:
nano /home/haxroomie/.haxroomie/config.js
and press Ctrl + K until the file is empty. Then paste the following script:
let config = {
room1: {
autoStart: true,
roomName: 'YOUR ROOM NAME HERE',
maxPlayers: 16,
public: true,
noPlayer: true,
token: 'YOUR TOKEN HERE',
roomScript: '/path/file/Haxbot_public.js',
},
};
module.exports = config;
Don't forget to change the roomName, maxPlayers, public, token and roomScript options accordingly.
Then, press Ctrl + X, Enter and Enter to save the file.
- Enter haxroomie in the terminal to launch the room. Enter min to minimize the process and close the terminal. Your room is open.
For more details about haxroomie, check out their website here.
There are 2 files in this repository, and they have the same core of functionalities, which are the following:
- Advanced statistics
- Discord integration
- Team chat and player chat
- Goal notification with shot speed
- Auto game recording
- Admin system
- Ban system
and much more!
To discover all the features of the bot, use the command !help
to check all commands. To go into the details of a command, type !help <command>
.
There are 2 files, based on whether you want your room to be public or not.
The private file is when there are no restrictions set in place and lets admins do everything.
For the public version, the bot handles setting up the teams correctly, and captains are able to pick their teams thanks to the choosing system, which remained the same as in the previous version.
To personalise the file, there are multiple steps to follow.
First, you are going to need the most obvious details, such as the room name, the number of players in the room, or the fact that the room is public or not. If your room isn't public, you can set maxPlayers at 40.
If you need to translate, search for room.sendAnnouncement
in the file, and modify the text that follows in your language. For an accurate translation, I recommend using DeepL.
Here are the steps to follow to link your room to Discord. It will give you the logs of your room and match reports for all matches played in your room.
- Create your Discord server or use one where you have admin rights.
- Create a log channel and a game channel.
- For each channel, create a webhook and copy their links.
- Replace
roomWebhook
by the webhook link of your log channel. - Replace
gameWebhook
by the webhook link of your game channel. - You have linked your room with Discord!
Once everything is setup, you will be able to check everything that happens in your room, as well as beautiful reports of all games played.
If you encounter any bug while using the bot, please file an issue with the complete console error message. Any incomplete issue will not be addressed.
Feel free to leave any suggestions in the Issues tab as well, and I will try to respond to them if I have time to spend on the project.
If you enjoy the bot, consider giving it a star to show your appreciation.