this post was submitted on 28 Oct 2023
7 points (100.0% liked)

Digital

260 readers
8 users here now

MTG Arena and Magic Online discussion

Discussion related to Magic's digital games, including MTG Arena and Magic Online (or MODO).

Learn more about MTG Arena and Magic Online!


founded 1 year ago
MODERATORS
 

I've been wanting to get started using XMage and thought it would be fun to play a few matches against the AI with the GRN Guild Kit decks (GK1) using the original printings. I found decklists on sites like mtg.wtf that list the card names and quantities, but they don't specify the original set name and card number for each card.

For example, this GitHub repo has decklists for various preconstructed decks, but also lacks the specific set information and card numbers.

What I'm really looking for are decklists that include the card name, quantity, set name, and card number in the set for each card, ideally formatted like this:

quantity [SETCODE:collector number] cardname

This .dck file format used by XMage would allow me to easily import the exact preconstructed deck I want to play with the original printings, without having to rebuild it.

It made me think how nice it would be to have all the preconstructed decks available as .dck files with the original printings specified, nicely organized into folders by product. That way I could easily grab the exact deck I want to play with in XMage without having to build it manually.

Does anyone know if prebuilt decklists with detailed set data like this already exist somewhere for preconstructed products like the Guild Kits? Or if not, I may try writing a script to generate them before manually creating the files myself.

Please let me know if you know of any resources where I could find complete decklists for preconstructed decks specifying the card names, quantities, set names, and card numbers! This would save me a lot of time in recreating the decks accurately in XMage.

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 2 points 1 year ago* (last edited 1 year ago)

tappedout exports as csv with set information:

.csv
Board,Qty,Name,Printing,Foil,Alter,Signed,Condition,Language
main,1,Beacon Bolt,GRN,,,,,

.dck
1 [GRN:?] Beacon Bolt

Here is a Python script that reads the .csv file and writes the required format to a .dck file. This script uses the csv module to read the .csv file and write to the .dck file.

import csv

def read_csv_file(file_path):
    with open(file_path, 'r') as file:
        return list(csv.reader(file))

def write_to_dck_file(file_path, data):
    with open(file_path, 'w') as file:
        file.writelines(data)

def convert_csv_to_dck_format(csv_data):
    csv_header, *csv_rows = csv_data
    return [format_dck_line(row) for row in csv_rows]

def format_dck_line(row):
    quantity, name, printing = row[1], row[2], row[3]
    return f"{quantity} [{printing}:?] {name}\n"

csv_data = read_csv_file('input.csv')
dck_data = convert_csv_to_dck_format(csv_data)
write_to_dck_file('output.dck', dck_data)

This script works as follows:

  1. It opens the .csv file in read mode.
  2. It creates a csv reader object to read the .csv file.
  3. It skips the header row using the next() function.
  4. It opens the .dck file in write mode.
  5. For each row in the .csv file, it formats the line as per the .dck file format. The format is "Quantity [Printing:?] Name". Here, Quantity is the second column in the .csv file, Printing is the fourth column, and Name is the third column.
  6. It writes the formatted line to the .dck file.

Please replace 'input.csv' with the path to your .csv file and 'output.dck' with the path where you want to create the .dck file. Run this script in a Python environment, and it will create the .dck file with the required format.