Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

96 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MTGOBot

.NET MTGO

An automated tournament data collection bot for Magic: The Gathering Online, powered by MTGOSDK. MTGOBot connects to a running MTGO client, monitors completed events, and records tournament results to a PostgreSQL database.

Getting Started

Prerequisites

  • .NET 10 SDK
  • A valid MTGO account
  • Access to a PostgreSQL database

Clone & Configure

git clone https://github.com/videre-project/MTGOBot.git
cd MTGOBot

Copy .env-example to .env and fill in your credentials:

# MTGO account
USERNAME=your_mtgo_username
PASSWORD=your_mtgo_password

# PostgreSQL connection
PGHOST=localhost
PGDATABASE=mtgo
PGUSER=postgres
PGPASSWORD=your_db_password

Running the Bot

Windows

MTGO runs natively on Windows. Use the .NET CLI to build and run:

dotnet run --project MTGOBot/MTGOBot.csproj

Linux (Wine)

On Linux, MTGO runs under Wine. Use the wine-run helper script to manage the Wine prefix and launch the bot:

wine-run MTGOBot/MTGOBot.csproj

Note

wine-run is provided by the mtgo-docker container image and handles Wine prefix setup, Xvfb initialization, and .NET execution under Wine.

Docker (Recommended for Production)

For headless, unattended operation, Docker provides a pre-configured environment with Wine, Xvfb, and .NET — no manual setup required.

Start the container:

docker-compose up -d

Launch the bot inside the container:

docker exec mtgobot wine-run

Follow logs:

docker logs -f mtgobot

Enter an interactive shell:

docker exec -it mtgobot bash

Project Structure

MTGOBot/
├── MTGOBot/              # C# bot source code
│   ├── Bot/              # Core bot logic, event queue, runner
│   ├── Database/         # PostgreSQL repository and schema definitions
│   └── Scraper/          # MTGO decklist and MTGGoldfish scrapers
├── docker-compose.yml    # Docker environment configuration
└── .env-example          # Environment variable template

License

Licensed under Apache-2.0.


This project is not affiliated with Wizards of the Coast or Daybreak Games.

About

A Magic: The Gathering Online (MTGO) bot for searching and reporting online events.

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages