This repository contains custom Tabletop Simulator (TTS) Lua scripts for automated card importing and game modules, alongside a high-performance, zero-CGO local Go proxy server with SQLite caching to optimize Scryfall API queries.
A local REST proxy that intercepts Scryfall API endpoints queried by Tabletop Simulator. It serves lookups, fuzzy matching, and deck lists locally using a pre-populated SQLite database, protecting Scryfall's APIs from rate-limits (429s).
- Offline Caching: Streams and parses Scryfall's
default-cardsbulk JSON file, importing 115,000+ cards into a B-Tree indexed SQLite database in transactions. - Fast Batch Resolving: Exposes a
/batchPOST endpoint that resolves entire 60-card decks in a single HTTP request in ~2ms. - Index-Only Name Matching: Utilizes exact and prefix range matching on cleaned names for sub-microsecond fuzzy lookups (no full-table scans).
- Cross-Platform CGO-Free Compilation: Written in pure Go with zero C-library compiler dependencies.
-
Rebuild the Database:
cd proxy go run . --update
-
Launch the Proxy Server:
go run .The server binds to port
8000by default (http://localhost:8000). -
Run Tests & Benchmarks:
go test -v -coverprofile=coverage.out go test -bench="." -benchmem
The Lua script integrates directly into Tabletop Simulator custom objects:
- Batch Spawning: Resolves decks synchronously in a single frame, building deck structures instantly on the table without staggered timers.
- Redirection: Dynamically proxies all Named, Set/Collector, Search, Random, Legalities, and Ruling requests through the local proxy.