#GUI Launcher (Thread Holder)
#Purpose
The GUI launcher is a Tkinter-based desktop application that acts as the primary control panel. It does not run bot logic directly — instead, it:
- Launches the bot script as a subprocess (via
.batfile) - Monitors process status through PID tracking
- Listens for remote commands via WebSocket
- Validates game memory before starting
Think of the GUI as a "thread holder" — it keeps the bot process alive and restarts it when needed.
#How It Works
User clicks "Start"
│
▼
GUI runs memory validation (FC24Memory / FC25Memory / UNDMemory)
│
▼
If validation passes → launches start.bat subprocess
│
├──▶ start.bat → python fc25.py (main bot)
└──▶ focus.bat → python focus.py (window focus helper)
│
▼
GUI saves PIDs to JSON file for tracking
│
▼
WebSocket listener runs in background thread
│
▼
On "stop-script" event → taskkill all tracked PIDs#PID Tracking System
The GUI uses a JSON file to persist process IDs across restarts:
| Game | PID File |
|---|---|
| FC24 | fc24_processes.json |
| FC25 | fc25_processes.json |
| Undisputed | undisputed_processes.json |
#JSON Format
{
"entries": [
{
"main": 12345,
"focus": 12346
}
]
}#PID Lifecycle Functions
| Function | Status | Description |
|---|---|---|
_read_pid_entries() |
ACTIVE | Read PIDs from JSON file |
_write_pid_entries() |
ACTIVE | Save PIDs to JSON file |
_clear_pid_entries() |
ACTIVE | Delete PID file |
_parse_pid() |
ACTIVE | Parse PID from int or string |
_pid_exists() |
ACTIVE | Check if PID is still running via tasklist |
_prune_pid_entries() |
ACTIVE | Remove dead PIDs from tracking |
_register_pid_entry() |
ACTIVE | Register new main+focus PID pair |
_collect_all_known_pids() |
ACTIVE | Collect all PIDs including WMIC fallback |
_any_process_running() |
ACTIVE | Check if any tracked process is alive |
#Differences Between Games
| Feature | FC24 | FC25 | Undisputed |
|---|---|---|---|
| Start script | start.bat |
fc25-start.bat |
und-start.bat |
| Focus helper | focus.bat |
focus.bat |
Built-in auto focus |
| Minutes setting | ✅ (7/10) | ✅ (7/10) | ❌ |
| Memory module | FC24Memory |
FC25Memory |
UNDMemory |
| UI style | Basic Tk | Basic Tk | Premium dark theme |
| Global hotkeys | ❌ | ❌ | ✅ (Shift+Plus/Minus) |
| Git pull support | ✅ | ✅ | ✅ |