bbsbot 2026-02-04
TW2002 twbot package built out with login reliability fixes, orientation system, and trading mechanics
64 files · 16,069+ · 37-

TW2002 bot package (twbot)

8 files changed
  • __init__.py Standalone twbot package root
  • bot.py Main TW2002 bot with modular structure
  • admin.py Admin tools for game configuration
  • login.py Login state machine with baud rate handling
  • orientation.py Three-layer orientation system with baud rate handling
  • trading.py Trading execution with port navigation and haggling
  • io.py IO layer for game communication
  • errors.py Error types for bot operations
  • Created standalone twbot package with modular structure: bot, admin, login, orientation, parsing, trading, io, errors instantiate behavioral
    6 files
    • __init__.py
    • bot.py
    • admin.py
    • login.py
    • orientation.py
    • trading.py
  • Implemented three-layer orientation system with baud rate handling instantiate internal
    1 file
    • orientation.py
  • Added trading execution with port navigation and haggling instantiate internal
    1 file
    • trading.py
  • Built admin tools for game configuration instantiate internal
    1 file
    • admin.py

Login and connection reliability

3 files changed
  • login.py Login timing fixes and state machine hardening
  • session.py Session wait_and_respond timeout increases
  • bot.py Division by zero fix and loop timing improvements
  • Fixed critical bot timing bug: wait for idle state before returning from wait_and_respond() remediate behavioral
    1 file
    • session.py
  • Increased login timeout from 5s to 10s for game server response time harden behavioral
    1 file
    • login.py
  • Increased wait_and_respond timeout from 10s to 20s for game loading delays harden internal
    1 file
    • session.py
  • Fixed division by zero in session summary when initial credits are 0 remediate internal
    1 file
    • bot.py
  • Fixed bot loop timing issue with variable timeouts and continue statements remediate internal
    1 file
    • bot.py

Validation and testing system

4 files changed
  • test_login_prompts.py Login sequence and prompt detection tests
  • test_login_sequence.py Login flow test coverage
  • test_orientation.py Orientation system test coverage
  • rules.json Validation rules added to TW2002 config (Phase 3)
  • Added comprehensive validation and menu exploration tests qualify internal
    3 files
    • test_login_prompts.py
    • test_login_sequence.py
    • test_orientation.py
  • Implemented screen content validation infrastructure (Phase 1-2) qualify internal
    1 file
    • extractor.py
  • Added validation rules to tw2002 config (Phase 3) baseline internal
    1 file
    • rules.json
  • Wired up validation checks in bot logic qualify internal
    1 file
    • bot.py

Pattern detection improvements

2 files changed
  • rules.py Pattern detection fixes and edge case documentation
  • prompts.json Expanded login prompt patterns
  • Fixed pattern detection and documented login edge cases remediate internal
    2 files
    • rules.py
    • prompts.json
  • Added pytest coverage for login sequence and prompt detection qualify behavioral
    1 file
    • test_login_prompts.py
  • Improved escape sequence handling in bbs_send remediate internal
    1 file
    • app.py

Debug tooling

2 files changed
  • DEBUG_GUIDE.md Systematic debugging guide for login issues
  • debug_login_diagnostic.py Login diagnostic tool for debugging stuck states
  • Added systematic debugging guide for login issues specify internal
    1 file
    • DEBUG_GUIDE.md
  • Added login diagnostic tools for debugging stuck states specify internal
    1 file
    • debug_login_diagnostic.py
  • Multiple debug scripts for game selection, login flow, and screen content specify internal
    3 files
    • debug_game_selection.py
    • debug_login_show_screens.py
    • debug_screen_content.py

Documentation

3 files changed
  • TEDIT_REFERENCE.md TEDIT login flow and MCP-BBS escape sequence handling docs
  • TWGS_LOGIN_FLOW.md TWGS login sequence documentation
  • IMPLEMENTATION_COMPLETE.md Implementation complete document with architecture and test results
  • Document TEDIT login flow and MCP-BBS escape sequence handling specify internal
    1 file
    • TEDIT_REFERENCE.md
  • Implementation complete document with architecture and test results specify internal
    1 file
    • IMPLEMENTATION_COMPLETE.md
  • TWGS login sequence documentation specify internal
    1 file
    • TWGS_LOGIN_FLOW.md