Skip to content

Instantly share code, notes, and snippets.

@Everlag
Last active January 22, 2022 04:30
Show Gist options
  • Save Everlag/fbc5a7fee7d1d6f1d79e4ca7cf65b9b0 to your computer and use it in GitHub Desktop.
Save Everlag/fbc5a7fee7d1d6f1d79e4ca7cf65b9b0 to your computer and use it in GitHub Desktop.
mtgtop8 xmage exporter
// Download an mtgtop8 decklist in a format compabible with xmage
//
// paste this into the dev console when viewing the .mwDeck
//
// Revision 2: includes a sideboard
sbindex = undefined; list = document.body.textContent.split('\n').filter((l)=> !l.includes('//')).map((l)=> l.replace(/\[.*\]\s/g, '').trim()); sbindex = list.findIndex(v => v.includes('SB')); list.splice(sbindex, 0, ''); list = list.map(v => v.replace(/SB:/, '').trim()); list = list.join('\n'); copy(list)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment