mse version: 2.0.0 short name: MWS full name: Plugin Exporter position hint: 900 icon: icon.png version: 2014-01-20 #Remember to update version at bottom of file. installer group: magic/Export/mws depends on: package: magic.mse-game version: 2009-07-23 game: magic create directory: true file type: *.txt|*.txt|*.*|*.* # By Pichoro # Based on code by Idle Muse, Innuendo and Seeonee option field: type: choice name: image type choice: full choice: crop description: Should the images exported be full card renders or art crops? option field: type: text name: date created description: The date this spoiler was first created. option field: type: text name: date modified description: The date this spoiler was last modified. option field: type: boolean name: export images description: Should images be exported? initial: yes script: mws_name := replace@(match:"‘", replace:"'")+ replace@(match:"’", replace:"'")+ replace@(match:"“", replace:"\"")+ replace@(match:"”", replace:"\"") mws_colored_art_check := replace@(match:" ", replace:"")+ replace@(match:"horizontal", replace:"")+ replace@(match:"vertical", replace:"")+ replace@(match:"radial", replace:"")+ replace@(match:"overlay", replace:"")+ replace@(match:"colorless", replace:"")+ replace@(match:"multicolor", replace:"")+ replace@(match:"hybrid", replace:"")+ replace@(match:"white", replace:"")+ replace@(match:"blue", replace:"")+ replace@(match:"black", replace:"")+ replace@(match:"red", replace:"")+ replace@(match:"green", replace:"")+ replace@(match:",,,,,,", replace:",,")+ replace@(match:",,,,,", replace:",,")+ replace@(match:",,,,", replace:",,")+ replace@(match:",,,", replace:",,") mws_mono_art_check := replace@(match:" ", replace:"")+ replace@(match:",", replace:"")+ replace@(match:"horizontal", replace:"")+ replace@(match:"vertical", replace:"")+ replace@(match:"radial", replace:"")+ replace@(match:"overlay", replace:"")+ replace@(match:"colorless", replace:"")+ replace@(match:"multicolor", replace:"")+ replace@(match:"hybrid", replace:"")+ replace@(match:"artifact", replace:"")+ replace@(match:"white", replace:"W")+ replace@(match:"blue", replace:"U")+ replace@(match:"black", replace:"B")+ replace@(match:"red", replace:"R")+ replace@(match:"green", replace:"G") mws_card_color:= { if contains(input, match:"land") then "Lnd" # All Lands are Lnd else if contains(card.shape, match:"Split") and card.card_color != card.card_color_2 then "Z" else if contains(input, match:"multicolor") then "Gld" # All Golds are Gld else if contains(input, match:"hybrid") then "Gld" # All Hybrids are Gld else if contains(mws_colored_art_check(input), match:",,artifact") then "Gld" # Artifacts w/ 2 or more colors are Gld else if contains(mws_colored_art_check(input), match:",artifact") then mws_mono_art_check(card.card_color) # Monocolor artifacts are that color else if contains(input, match:"artifact") then "Art" # Colorless artifacts are Art else if contains(input, match:"white") then "W" else if contains(input, match:"blue") then "U" else if contains(input, match:"black") then "B" else if contains(input, match:"red") then "R" else if contains(input, match:"green") then "G" else "Art" } mws_cost := replace@(match:"2/W", replace:"%E")+ replace@(match:"2/U", replace:"%F")+ replace@(match:"2/B", replace:"%H")+ replace@(match:"2/R", replace:"%J")+ replace@(match:"2/G", replace:"%M")+ replace@(match:"S", replace:"%N")+ replace@(match:"W/U", replace:"%D")+ replace@(match:"W/B", replace:"%O")+ replace@(match:"U/B", replace:"%V")+ replace@(match:"U/R", replace:"%I")+ replace@(match:"B/R", replace:"%K")+ replace@(match:"B/G", replace:"%Q")+ replace@(match:"R/G", replace:"%L")+ replace@(match:"R/W", replace:"%P")+ replace@(match:"G/W", replace:"%A")+ replace@(match:"G/U", replace:"%S") mws_type := replace@(match:"—", replace:"-") mws_rules := # Longdashes should be short. replace@(match:"—", replace:"-")+ # Linebreaks should be double spaces. replace@(match:"\n", replace:" ")+ # No curly quotes or apostrophes. replace@(match:"‘", replace:"'")+ replace@(match:"’", replace:"'")+ replace@(match:"“", replace:"\"")+ replace@(match:"”", replace:"\"")+ # Pound signs around parenthesis. replace@(match:"[(]", replace:"#(")+ replace@(match:"[)]", replace:")#")+ # Just automatically symbolize all hybrids. replace@(match:"2/W", replace:"%E")+ replace@(match:"2/U", replace:"%F")+ replace@(match:"2/B", replace:"%H")+ replace@(match:"2/R", replace:"%J")+ replace@(match:"2/G", replace:"%M")+ replace@(match:"W/U", replace:"%D")+ replace@(match:"W/B", replace:"%O")+ replace@(match:"U/B", replace:"%V")+ replace@(match:"U/R", replace:"%I")+ replace@(match:"B/R", replace:"%K")+ replace@(match:"B/G", replace:"%Q")+ replace@(match:"R/G", replace:"%L")+ replace@(match:"R/W", replace:"%P")+ replace@(match:"G/W", replace:"%A")+ replace@(match:"G/U", replace:"%S")+ # Various positions for taps and untaps. replace@(match:" T ", replace:" %T ")+ replace@(match:" Q ", replace:" %C ")+ replace@(match:"T,", replace:"%T,")+ replace@(match:"Q,", replace:"%C,")+ replace@(match:"T:", replace:"%T:")+ replace@(match:"Q:", replace:"%C:")+ # Mana right before a space. replace@(match:"G ", replace:"%G ")+ replace@(match:"R ", replace:"%R ")+ replace@(match:"B ", replace:"%B ")+ replace@(match:"U ", replace:"%U ")+ replace@(match:"W ", replace:"%W ")+ replace@(match:"S ", replace:"%N ")+ # Mana right before a comma. replace@(match:"G,", replace:"%G,")+ replace@(match:"R,", replace:"%R,")+ replace@(match:"B,", replace:"%B,")+ replace@(match:"U,", replace:"%U,")+ replace@(match:"W,", replace:"%W,")+ replace@(match:"S,", replace:"%N,")+ # Mana right before a colon. replace@(match:"G:", replace:"%G:")+ replace@(match:"R:", replace:"%R:")+ replace@(match:"B:", replace:"%B:")+ replace@(match:"U:", replace:"%U:")+ replace@(match:"W:", replace:"%W:")+ replace@(match:"S:", replace:"%N:")+ replace@(match:"Y:", replace:"%Y:")+ replace@(match:"X:", replace:"%X:")+ # Drag rules text to search for more mana characters. Reverse color wheel order works better. Repeat several times. replace@(match:"G%", replace:"%G%")+ replace@(match:"R%", replace:"%R%")+ replace@(match:"B%", replace:"%B%")+ replace@(match:"U%", replace:"%U%")+ replace@(match:"W%", replace:"%W%")+ replace@(match:"G%", replace:"%G%")+ replace@(match:"R%", replace:"%R%")+ replace@(match:"B%", replace:"%B%")+ replace@(match:"U%", replace:"%U%")+ replace@(match:"W%", replace:"%W%")+ replace@(match:"G%", replace:"%G%")+ replace@(match:"R%", replace:"%R%")+ replace@(match:"B%", replace:"%B%")+ replace@(match:"U%", replace:"%U%")+ replace@(match:"W%", replace:"%W%")+ # Symbolize snow. replace@(match:"S%", replace:"%N%")+ replace@(match:"S%", replace:"%N%")+ replace@(match:"S%", replace:"%N%")+ # Symbolize numbers from 10-0 that are before other symbols. replace@(match:"10%", replace:"%10%")+ replace@(match:"9%", replace:"%9%")+ replace@(match:"8%", replace:"%8%")+ replace@(match:"7%", replace:"%7%")+ replace@(match:"6%", replace:"%6%")+ replace@(match:"5%", replace:"%5%")+ replace@(match:"4%", replace:"%4%")+ replace@(match:"3%", replace:"%3%")+ replace@(match:"2%", replace:"%2%")+ replace@(match:"1%", replace:"%1%")+ replace@(match:"0%", replace:"%0%")+ # Symbolize numbers from 10-0 that are before colons. replace@(match:"10:", replace:"%10:")+ replace@(match:"9:", replace:"%9:")+ replace@(match:"8:", replace:"%8:")+ replace@(match:"7:", replace:"%7:")+ replace@(match:"6:", replace:"%6:")+ replace@(match:"5:", replace:"%5:")+ replace@(match:"4:", replace:"%4:")+ replace@(match:"3:", replace:"%3:")+ replace@(match:"2:", replace:"%2:")+ replace@(match:"1:", replace:"%1:")+ replace@(match:"0:", replace:"%0:")+ # Symbolize numbers from 10-0 that are before commas. replace@(match:"10,", replace:"%10,")+ replace@(match:"9,", replace:"%9,")+ replace@(match:"8,", replace:"%8,")+ replace@(match:"7,", replace:"%7,")+ replace@(match:"6,", replace:"%6,")+ replace@(match:"5,", replace:"%5,")+ replace@(match:"4,", replace:"%4,")+ replace@(match:"3,", replace:"%3,")+ replace@(match:"2,", replace:"%2,")+ replace@(match:"1,", replace:"%1,")+ replace@(match:"0,", replace:"%0,")+ # Symbolize X and Y that are before other symbols. replace@(match:"Y%", replace:"%Y%")+ replace@(match:"X%", replace:"%X%")+ # Symbolize X and Y that are before colons. replace@(match:"Y:", replace:"%Y:")+ replace@(match:"X:", replace:"%X:")+ # Symbolize X and Y that are before commas. replace@(match:"Y,", replace:"%Y,")+ replace@(match:"X,", replace:"%X,")+ # Get rid of extra symbolizations. replace@(match:"%%%", replace:"%")+ replace@(match:"%%", replace:"%") mws_flavor := replace@(match:"—", replace:"-")+ replace@(match:"‘", replace:"'")+ replace@(match:"’", replace:"'")+ replace@(match:"“", replace:"\"")+ replace@(match:"”", replace:"\"")+ replace@(match:"\n", replace:" ") mws_artist := replace@(match:"Illus. ", replace:"")+ replace@(match:"‘", replace:"'")+ replace@(match:"’", replace:"'")+ replace@(match:"“", replace:"\"")+ replace@(match:"”", replace:"\"") mws_rarity := { if contains(card.rarity, match:"basic land") then "C" else if contains(card.rarity, match:"uncommon") then "U" else if contains(card.rarity, match:"common") then "C" else if contains(card.rarity, match:"rare") then "R" else if contains(card.rarity, match:"special") then "R" else "C" } paragraph_count := replace@(match:"\n", replace:"•")+ filter_text@(match:"•") write_normal := {"\nCard Name: "+mws_name(card.name) +"\nCard Color: "+mws_card_color(card.card_color) +"\nMana Cost: "+mws_cost(card.casting_cost) +"\nType & Class: "+mws_type(card.type) +"\nPow/Tou: "+card.pt +"\nCard Text: "+mws_rules(remove_tags(card.rule_text)) +"\nFlavor Text: "+mws_flavor(card.flavor_text) +"\nArtist: "+mws_artist(card.illustrator) +"\nRarity: "+mws_rarity() +"\nCard #: "+card.card_number +"\n" } write_split := {"\nCard Name: "+mws_name(card.name)+"/"+mws_name(card.name_2) +"\nCard Color: "+mws_card_color(card.card_color)+"/"+mws_card_color(card.card_color_2) +"\nMana Cost: "+mws_cost(card.casting_cost)+"/"+mws_cost(card.casting_cost_2) +"\nType & Class: "+mws_type(card.type)+"/"+mws_type(card.type_2) +"\nPow/Tou: "+card.pt +"\nCard Text: "+mws_rules(remove_tags(card.rule_text))+" // "+mws_rules(remove_tags(card.rule_text_2)) +"\nFlavor Text: "+mws_flavor(card.flavor_text)+" // "+mws_flavor(card.flavor_text_2) +"\nArtist: "+mws_artist(card.illustrator)+"/"+mws_artist(card.illustrator_2) +"\nRarity: "+mws_rarity() +"\nCard #: "+card.card_number +"\n" } write_flip := {"\nCard Name: "+mws_name(card.name) +"\nCard Color: "+mws_card_color(card.card_color) +"\nMana Cost: "+mws_cost(card.casting_cost) +"\nType & Class: "+mws_type(card.type) +"\nPow/Tou: "+card.pt +"\nCard Text: "+mws_rules(remove_tags(card.rule_text)) +" ----- " +card.name_2+" " +card.type_2+" " +card.pt_2+" " +mws_rules(remove_tags(card.rule_text_2)) +"\nFlavor Text: "+mws_flavor(card.flavor_text) +"\nArtist: "+mws_artist(card.illustrator) +"\nRarity: "+mws_rarity() +"\nCard #: "+card.card_number +"\n" } write_dfc := {"\nCard Name: "+mws_name(card.name) +"\nCard Color: "+mws_card_color(card.card_color) +"\nMana Cost: "+mws_cost(card.casting_cost) +"\nType & Class: "+mws_type(card.type) +"\nPow/Tou: "+card.pt +"\nCard Text: "+mws_rules(remove_tags(card.rule_text)) +" ----- " +card.name_2+" " +card.type_2+" " +card.pt_2+" " +mws_rules(remove_tags(card.rule_text_2)) +"\nFlavor Text: "+mws_flavor(card.flavor_text) +"\nArtist: "+mws_artist(card.illustrator) +"\nRarity: "+mws_rarity() +"\nCard #: "+card.card_number +"\n" } write_walker := {"\nCard Name: "+mws_name(card.name) +"\nCard Color: "+mws_card_color(card.card_color) +"\nMana Cost: "+mws_cost(card.casting_cost) +"\nType & Class: "+mws_type(card.type) +"\nPow/Tou: %"+card.loyalty +"\nCard Text: " +card.loyalty_cost_1 +(if card.loyalty_cost_1 !="" then ": ") +mws_rules(split_text(match:"\n", card.rule_text).0)+" " +card.loyalty_cost_2 +(if card.loyalty_cost_2 !="" then ": ") +(if contains(paragraph_count(card.rule_text), match:"•") then mws_rules(split_text(match:"\n", card.rule_text).1)+" ") +card.loyalty_cost_3 +(if card.loyalty_cost_3 !="" then ": ") +(if contains(paragraph_count(card.rule_text), match:"••") then mws_rules(split_text(match:"\n", card.rule_text).2)+" ") +card.loyalty_cost_4 +(if card.loyalty_cost_4 !="" then ": ") +(if contains(paragraph_count(card.rule_text), match:"•••") then mws_rules(split_text(match:"\n", card.rule_text).3)) +"\nFlavor Text: "+mws_flavor(card.flavor_text) +"\nArtist: "+mws_artist(card.illustrator) +"\nRarity: "+mws_rarity() +"\nCard #: "+card.card_number +"\n" } write_leveler := {"\nCard Name: "+mws_name(card.name) +"\nCard Color: "+mws_card_color(card.card_color) +"\nMana Cost: "+mws_cost(card.casting_cost) +"\nType & Class: "+mws_type(card.type) +"\nPow/Tou: "+card.pt +"\nCard Text: " +mws_rules(card.rule_text)+" " +(if card.level_1 !="" then "[LEVEL ") +card.level_1 +(if card.level_1 !="" then "]: ") +mws_rules(card.rule_text_2) +" ("+card.pt_2+") " +(if card.level_2 !="" then "[LEVEL ") +card.level_2 +(if card.level_2 !="" then "]: ") +mws_rules(card.rule_text_3) +" ("+card.pt_3+")" +"\nFlavor Text: "+mws_flavor(card.flavor_text) +"\nArtist: "+mws_artist(card.illustrator) +"\nRarity: "+mws_rarity() +"\nCard #: "+card.card_number +"\n" } write_card := { if contains(card.shape, match:"token") then "" else if contains(card.shape, match:"rulestip") then "" else if contains(card.shape, match:"counter") then "" else if contains(card.shape, match:"emblem") then "" else if contains(card.shape, match:"split") then write_split() else if contains(card.shape, match:"double faced") then write_dfc() else if card.name_2 != "" then write_flip() else if card.loyalty != "" then write_walker() else if contains(card.shape, match:"leveler") then write_leveler() else write_normal() } write_cards := to_text(for each card in sort_list(set, order_by: {card.card_number}) do write_card()) write_images := if options.export_images then (for each card in cards do write_image_file((if options.image_type =="full" then card else card.image), file:"{card.name}{if options.image_type == "full" then ".full" else ""}.jpg")) else "" to_string(set.title+" Spoiler List\n" +set.description+"\n" +"Spoiler List created on "+options.date_created+"\n" +"Last Updated on: "+options.date_modified +"\n\nSpoiler generated by Magic Set Editor 2 Beta 0.3.8 Using the MWS Export Template version 2010-12-23" +"\nExport Template by Pichoro" +"\nThe only person who assumes any liability for damages from the use of this file is the user." +"\n\nDirections for use:" +"\nOpen MWS." +"\nGo to Tools menu->Analyze/Add/Remove Sets." +"\n'Add New Edition'." +"\nEnter set name and key." +"\nCheck 'get data from text spoiler' and browse to whatever location you stored this file at.\n" +"Hit 'Next Page', then 'Add Edition'." +"\nThen, after that closes, hit the 'Save Current Base/Deck' button at the top of your screen." +"\nRestart Magic Workstation, and enjoy the cards.\n" +"\n\nWhen using the images, you must rename the folder to the set key you entered into MWS when importing this text file!\n" +write_cards)