Skip to content

sobrinN/Haxbot-sobrinN

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Haxbot sobrinN

Headless bot for HaxBall with automatic team balancing, persistent statistics, ranking system, and solo practice mode.


Overview

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)

Features

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

Getting Started

Requirements

Running

  1. Open the HaxBall Headless page
  2. Paste the contents of haxbot-sobrinN.js into the browser console
  3. Solve the recaptcha (or configure a token in HBInit)
  4. The room will be created automatically

VPS (Recommended)

When running on a VPS with Chrome 78+, use the flag:

chrome --disable-features=WebRtcHideLocalIpsWithMdns

Commands

Player Commands

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

Admin Commands

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

Architecture

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

Match Flow

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 System

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+

Security

  • 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)

License

Personal project. Private use.

About

Headless bot for HaxBall — auto-balance, stats, ranking, solo practice

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors