SkillAgentSearch skills...

BF2AutoSpectator

An automated spectator for Battlefield 2 written in Python

Install / Use

/learn @cetteup/BF2AutoSpectator
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

BF2AutoSpectator

An automated spectator for Battlefield 2 written in Python 🐍

Battefield 2 might be an old game that is known for sometimes having more dust than hit registration. But it's still around after 15 years and people still play it. So, why not support this game and community with an automated spectator that makes it easy to, for example, stream this game around the clock so people can (re-)discover it via a live stream.

Project state

The goal is to provide a fully automated, fire-and-forget spectator for the game. However, this project is currently in a beta-like state. Thus, some monitoring of the spectator and any live stream is strongly recommended.

Features

  • automatic start of a BF2 game instance (can be disabled to attach to an existing instance)
  • automatic account login
  • automatic server join (only by server ip; custom ports and server passwords are supported)
  • automatic spawning in game to enable "spectator mode" (see supported maps/sizes below)
  • automatic rotation between players of spectator's team
  • restart spectating after round restart
  • purge server history before launching the game via bf2-conman
  • in game error detection and handling
  • game freeze detection and handling
  • support for 720p (1280x720) and 900p (1600x900) game window size/resolution
  • (optional) remote control using bf2-auto-spectator-controller
  • (optional) control live stream via OBS WebSocket

Command line arguments

| Argument | Description | Default | Required | |-------------------------|----------------------------------------------------------------|------------------------------------------------|----------| | --version | Output version information | | | | --player-name | Name of bf2hub account | None | Yes | | --player-password | Passwort for bf2hub account | None | Yes | | --server-ip | IP of server to join | None | Yes | | --server-port | Port of server to join | 16567 | No | | --server-pass | Passwort for server to join | None | No | | --server-mod | Mod of server to join | bf2 | No | | --game-path | Path to BF2 install folder | C:\Program Files (x86)\EA Games\Battlefield 2\ | No | | --game-res | Resolution to use for BF2 window | 720p | No | | --tesseract-path | Path to Tesseract install folder | C:\Program Files\Tesseract-OCR\ | No | | --use-controller | Use a bf2-auto-spectator-controller instance | | | | --controller-base-uri | Base uri of controller instance (format: http[s]://[hostname]) | | | | --control-obs | Control OBS via WebSocket | | | | --obs-url | OBS WebSocket URL (format: ws://:password@hostname:port) | | | | --debug-log | Add debugging information to log output | | | | --debug-screenshot | Write any screenshots to disk for debugging | | |

You can always get these details locally by providing the --help argument.

Supported maps for auto-spawning

Vanilla maps

| Map name | 16 size | 32 size | 64 size | |------------------------|---------|---------|---------| | Dalian Plant | Yes | Yes | Yes | | Daqing Oilfields | Yes | Yes | Yes | | Dragon Valley | Yes | Yes | Yes | | FuShe Pass | Yes | Yes | Yes | | Great Wall | Yes | Yes | n/a | | Gulf of Oman | Yes | Yes | Yes | | Highway Tampa | Yes | Yes | Yes | | Kubra Dam | Yes | Yes | Yes | | Mashtuur City | Yes | Yes | Yes | | Midnight Sun | Yes | Yes | Yes | | Operation Blue Pearl | Yes | Yes | Yes | | Operation Clean Sweep | Yes | Yes | Yes | | Operation Harvest | Yes | Yes | Yes | | Operation Road Rage | Yes | Yes | Yes | | Operation Smoke Screen | Yes | Yes | n/a | | Road to Jalalabad | Yes | Yes | Yes | | Sharqi Peninsula | Yes | Yes | Yes | | Songhua Stalemate | Yes | Yes | Yes | | Strike at Karkand | Yes | Yes | Yes | | Taraba Quarry | Yes | Yes | n/a | | Wake Island 2007 | n/a | n/a | Yes | | Zatar Wetlands | Yes | Yes | Yes |

Special Forces maps

| Map name | 16 size | 32 size | 64 size | |------------------------|---------|---------|---------| | Devil's Perch | Yes | Yes | Yes | | Ghost Town | Yes | Yes | Yes | | Leviathan | Yes | Yes | Yes | | Mass Destruction | Yes | Yes | Yes | | Night Flight | Yes | Yes | Yes | | Surge | Yes | Yes | Yes | | The Iron Gator | Yes | Yes | Yes | | Warlord | Yes | Yes | Yes |

Battlefield Pirates 2 mod maps

| Map name | 16 size | 32 size | 64 size | |------------------------------|---------|---------|---------| | Black Beard's Atol | Yes | Yes | Yes | | Black Beard's Atol - CTF | n/a | n/a | Yes | | Blue Bayou | Yes | Yes | Yes | | Blue Bayou - CTF | n/a | n/a | Yes | | Blue Bayou - Zombie ¹ | n/a | n/a | Yes | | Crossbones Keep | Yes | Yes | Yes | | Crossbones Keep - Zombie ¹ | n/a | n/a | Yes | | Dead Calm | Yes | Yes | Yes | | Frylar | Yes | Yes | Yes | | Frylar - CTF | n/a | n/a | Yes | | Frylar - Zombie ¹ | n/a | n/a | Yes | | Lost At Sea | Yes | Yes | Yes | | O'Me Hearty Beach | Yes | Yes | Yes | | O'Me Hearty Beach - Zombie ¹ | n/a | n/a | Yes | | Pelican Point | Yes | Yes | Yes | | Pelican Point - CTF | n/a | n/a | Yes | | Pressgang Port | Yes | Yes | Yes | | Pressgang Port - CTF | n/a | n/a | Yes | | Sailors Warning | Yes | Yes | Yes | | Shallow Draft | Yes | Yes | Yes | | Shallow Draft - CTF | n/a | n/a | Yes | | Shipwreck Shoals | Yes | Yes | Yes | | Shipwreck Shoals - CTF | n/a | n/a | Yes | | Shiver Me Timbers | Yes | Yes | Yes | | Shiver Me Timbers - CTF | n/a | n/a | Yes | | Storm the Bastion | Yes | Yes | Yes | | Storm the Bastion - Zombie ¹ | n/a | Yes | Yes | | Stranded | Yes | Yes | Yes | | Stranded - CTF | n/a | n/a | Yes | | Wake Island 1707 | Yes | Yes | Yes |

¹ spawning on zombie versions of maps may fail if the spectator happens to be a zombie, since the zombie class is not always selected by default

Arctic Warfare mod maps

| Map name | 16 size | 32 size | 64 size | |-----------------|---------|---------|---------| | Rocky Mountains | Yes | Yes | Yes | | Yukon Bridge | Yes | Yes | Yes |

Custom maps

| Map name | 16 size | 32 size | 64 size | |-----------------------------------------------------------------------------------------------|---------|---------|---------| | Dalian 2v2 | Yes | Yes | Yes | | Daqing 2v2 | Yes | Yes | Yes | | Dragon 2v2 | Yes | n/a ¹ | n/a ¹ | | Sharqi 2v2 | Yes | Yes | Yes | | Alpin Ressort | Yes | Yes | Yes | | Blitzkrieg | Yes | n/a | n/a | | [Christmas Hill](https://www.

View on GitHub
GitHub Stars15
CategoryProduct
Updated1mo ago
Forks4

Languages

Python

Security Score

90/100

Audited on Feb 13, 2026

No findings