Last active
January 22, 2022 04:30
-
-
Save Everlag/fbc5a7fee7d1d6f1d79e4ca7cf65b9b0 to your computer and use it in GitHub Desktop.
mtgtop8 xmage exporter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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