Headless bot for HaxBall with automatic team balancing, persistent statistics, ranking system, and solo practice mode.
Automated bot for a Futsal 3v3 HaxBall room. Manages matches, teams, player statistics, and moderation without requiring a human admin.
Runtime : Browser console on HaxBall Headless Host
Language : Single-file JavaScript (~2100 lines)
Locale : Brazilian Portuguese (all user-facing strings)
Feature
Description
Auto-Balance
Distributes players automatically as they join or leave
Draft Mode
Captains pick players when the room has more than 6 players
Statistics
Goals, assists, wins, GK saves, clean sheets — persisted via localStorage
Ranking
Rank system from Bronze I to Lenda do x3 (500+ goals)
Solo Practice
Single player can train and score from both sides of the field
Uniforms
Captains can switch team kits with chat commands
Anti-Spam
Automatic ban for spam (5+ messages within 3 seconds)
Chat Filter
Filters profanity and racist content (kick without ban)
AFK Detection
Kicks inactive players after 12 seconds during a match
Golden Goal
Overtime golden goal when regulation time ends tied
Team Chat
Private chat between teammates using t message
Open the HaxBall Headless page
Paste the contents of haxbot-sobrinN.js into the browser console
Solve the recaptcha (or configure a token in HBInit)
The room will be created automatically
When running on a VPS with Chrome 78+, use the flag:
chrome --disable-features=WebRtcHideLocalIpsWithMdns
Command
Description
!help / !ajuda
List available commands
!me
Show your stats (private)
!mostrarme
Show your stats publicly
!afk
Toggle AFK status
!uni / !unis
List available uniforms
!ranks / !ranks2
Rank table
!games
Top 5 by matches played
!wins
Top 5 by wins
!goals
Top 5 by goals
!assists
Top 5 by assists
!cs
Top 5 by clean sheets
!bb / !bye
Leave the room
!dc / !discord
Discord link
t message
Private team chat
Uniform Commands (Captain only)
Command
Team
!bra
Brazil
!arg
Argentina
!ale
Germany
!fra
France
!esp
Spain
!por
Portugal
!ita
Italy
!ing
England
!uru
Uruguay
!bel
Belgium
!hol
Netherlands
Command
Description
!loginadm <password>
Authenticate as admin
!mute <min> #<id>
Mute a player
!unmute all/#<id>
Unmute
!clearbans
Clear all bans
!clearbans <id>
Clear a specific ban
haxbot-sobrinN.js # Single file — complete bot
Configuration HBInit, map, limits
Team System Auto-balance, draft, captains
Statistics Possession, goals, assists, GK, ranking
Moderation Anti-spam, word filter, AFK
HaxBall Events onPlayerJoin/Leave/Chat, onTeamGoal, etc.
Solo Mode Automatic team swap after goal
Player joins -> Auto-balance -> Match starts
|
Goal scored -> Announcements + Avatars
|
Score/Time limit -> endGame()
|
onGameStop -> Team rotation
|
>= 5 players? -> Draft Mode
< 5 players? -> Auto-start
Rank
Goals Required
Sem rank
0-2
Bronze I-III
3 / 6 / 9
Prata I-III
11 / 16 / 21
Ouro I-III
31 / 36 / 41
Platina I-III
51 / 56 / 61
Diamante I-IV
81 / 121 / 151 / 201
Lenda do x3
501+
Bans only for spam (5 msgs/3s) — all other violations result in kicks without ban
Racist content filter (kick without ban)
All bans are cleared automatically on bot restart
Admin login via private command (hidden from public chat)
Statistics tied to player.auth (identity verified by HaxBall)
Personal project. Private use.