1
0
Fork 0
mirror of https://github.com/correl/mage.git synced 2025-04-08 17:00:07 -09:00

Merge pull request from spjspj/master

Add in c17 decks
This commit is contained in:
spjspj 2017-08-31 02:15:51 +10:00 committed by GitHub
commit f4a69aa86f
6 changed files with 1290 additions and 0 deletions

View file

@ -0,0 +1,89 @@
1 [C17:106] Corpse Augur
1 [C17:10] Galecaster Colossus
1 [C17:111] Decree of Pain
1 [C17:114] Go for the Throat
1 [C17:115] Magus of the Abyss
1 [C17:117] Necromantic Selection
1 [C17:121] Puppeteer Clique
1 [C17:12] Magus of the Mind
1 [C17:131] Chaos Warp
1 [C17:132] Comet Storm
1 [C17:13] Portal Mage
1 [C17:14] Bloodline Necromancer
1 [C17:166] Cauldron Dance
1 [C17:169] Crosis's Charm
1 [C17:16] Curse of Disturbance
1 [C17:171] Etherium-Horn Sorcerer
1 [C17:173] Havengul Lich
1 [C17:175] Izzet Chronarch
1 [C17:177] Marchesa, the Black Rose
1 [C17:178] Memory Plunder
1 [C17:180] Mercurial Chemister
1 [C17:183] Nin, the Pain Artist
1 [C17:185] Niv-Mizzet, the Firemind
1 [C17:186] Nivix Guildmage
1 [C17:18] Kindred Dominance
1 [C17:190] Rakdos Charm
1 [C17:193] Shadowmage Infiltrator
1 [C17:195] Silumgar's Command
1 [C17:199] Terminate
1 [C17:201] Vela the Night-Clad
1 [C17:206] Commander's Sphere
1 [C17:207] Darksteel Ingot
1 [C17:210] Fellwar Stone
1 [C17:217] Nevinyrral's Disk
1 [C17:21] Vindictive Lich
1 [C17:223] Sol Ring
1 [C17:229] Unstable Obelisk
1 [C17:232] Worn Powerstone
1 [C17:242] Command Tower
1 [C17:244] Crumbling Necropolis
1 [C17:245] Dimir Aqueduct
1 [C17:246] Dismal Backwater
1 [C17:248] Evolving Wilds
1 [C17:249] Exotic Orchard
1 [C17:24] Curse of Opulence
1 [C17:254] Grixis Panorama
1 [C17:256] Izzet Boilerworks
1 [C17:258] Jwar Isle Refuge
1 [C17:264] Mystifying Maze
1 [C17:26] Izzet Chemister
1 [C17:270] Rakdos Carnarium
1 [C17:283] Swiftwater Cliffs
1 [C17:284] Temple of the False God
1 [C17:285] Terramorphic Expanse
1 [C17:289] Vivid Crag
1 [C17:28] Shifting Shadow
1 [C17:290] Vivid Creek
1 [C17:292] Vivid Marsh
1 [C17:305] Mountain
1 [C17:306] Mountain
1 [C17:39] Kess, Dissident Mage
1 [C17:41] Mairsil, the Pretender
1 [C17:47] Taigam, Sidisi's Hand
1 [C17:54] Mirror of the Forebears
1 [C17:56] Path of Ancestry
1 [C17:80] Arcanis the Omnipotent
1 [C17:81] Archaeomancer
1 [C17:82] Azami, Lady of Scrolls
1 [C17:83] Body Double
1 [C17:84] Clone Legion
1 [C17:85] Harbinger of the Tides
1 [C17:86] Into the Roil
1 [C17:87] Merchant of Secrets
1 [C17:89] Opportunity
1 [C17:90] Polymorphist's Jest
1 [C17:91] Reality Shift
1 [C17:92] Sea Gate Oracle
1 [C17:93] Serendib Sorcerer
1 [C17:94] Spelltwine
1 [C17:97] Apprentice Necromancer
1 [C17:9] Curse of Verbosity
2 [C17:301] Swamp
2 [C17:302] Swamp
2 [C17:303] Swamp
2 [C17:304] Mountain
3 [C17:298] Island
3 [C17:300] Island
4 [C17:299] Island
SB: 1 [C17:38] Inalla, Archmage Ritualist

View file

@ -0,0 +1,97 @@
1 [C17:234] Arcane Sanctum
1 [C17:203] Armillary Sphere
1 [C17:161] Atarka, World Render
1 [C17:163] Bladewing the Risen
1 [C17:15] Boneyard Scourge
1 [C17:165] Broodmate Dragon
1 [C17:242] Command Tower
1 [C17:206] Commander's Sphere
1 [C17:168] Crosis, the Purger
1 [C17:133] Crucible of Fire
1 [C17:243] Crucible of the Spirit Dragon
1 [C17:244] Crumbling Necropolis
1 [C17:107] Crux of Fate
1 [C17:147] Cultivate
1 [C17:30] Curse of Bounty
1 [C17:24] Curse of Opulence
1 [C17:9] Curse of Verbosity
1 [C17:207] Darksteel Ingot
1 [C17:110] Deathbringer Regent
1 [C17:134] Dragon Tempest
1 [C17:135] Dragonlord's Servant
1 [C17:136] Dragonspeaker Shaman
1 [C17:209] Dreamstone Hedron
1 [C17:170] Dromoka, the Eternal
1 [C17:137] Earthquake
1 [C17:148] Elemental Bond
1 [C17:149] Farseek
1 [C17:211] Fist of Suns
1 [C17:307] Forest
1 [C17:308] Forest
1 [C17:309] Forest
1 [C17:4] Fortunate Few
1 [C17:37] Fractured Identity
1 [C17:251] Frontier Bivouac
1 [C17:150] Frontier Siege
1 [C17:255] Haven of the Spirit Dragon
1 [C17:138] Hellkite Charger
1 [C17:53] Herald's Horn
1 [C17:174] Intet, the Dreamer
1 [C17:298] Island
1 [C17:299] Island
1 [C17:300] Island
1 [C17:257] Jungle Shrine
1 [C17:11] Kindred Discovery
1 [C17:154] Kodama's Reach
1 [C17:176] Kolaghan, the Storm's Fury
1 [C17:215] Lightning Greaves
1 [C17:54] Mirror of the Forebears
1 [C17:88] Monastery Siege
1 [C17:263] Mystic Monastery
1 [C17:218] Nihil Spellbomb
1 [C17:184] Niv-Mizzet, Dracogenius
1 [C17:265] Nomad Outpost
1 [C17:45] O-Kagachi, Vengeful Kami
1 [C17:187] Ojutai, Soul of Winter
1 [C17:267] Opulent Palace
1 [C17:67] Orator of Ojutai
1 [C17:118] Painful Truths
1 [C17:119] Palace Siege
1 [C17:56] Path of Ancestry
1 [C17:295] Plains
1 [C17:296] Plains
1 [C17:297] Plains
1 [C17:156] Rain of Thorns
1 [C17:55] Ramos, Dragon Engine
1 [C17:141] Ryusei, the Falling Star
1 [C17:274] Sandsteppe Citadel
1 [C17:275] Savage Lands
1 [C17:191] Savage Ventmaw
1 [C17:6] Scalelord Reckoner
1 [C17:192] Scion of the Ur-Dragon
1 [C17:142] Scourge of Valkas
1 [C17:277] Seaside Citadel
1 [C17:194] Silumgar, the Drifting Death
1 [C17:223] Sol Ring
1 [C17:196] Spellbound Dragon
1 [C17:225] Steel Hellkite
1 [C17:74] Sunscorch Regent
1 [C17:301] Swamp
1 [C17:302] Swamp
1 [C17:303] Swamp
1 [C17:46] Taigam, Ojutai Master
1 [C17:198] Teneb, the Harvester
1 [C17:29] Territorial Hellkite
1 [C17:143] Tyrant's Familiar
1 [C17:144] Utvara Hellkite
1 [C17:289] Vivid Crag
1 [C17:290] Vivid Creek
1 [C17:291] Vivid Grove
1 [C17:292] Vivid Marsh
1 [C17:293] Vivid Meadow
1 [C17:49] Wasitora, Nekoru Queen
1 [C17:230] Wayfarer's Bauble
2 [C17:304] Mountain
2 [C17:305] Mountain
2 [C17:306] Mountain
SB: 1 [C17:48] The Ur-Dragon

View file

@ -0,0 +1,92 @@
1 [C17:145] Abundance
1 [C17:1] Alms Collector
1 [C17:202] Argentum Armor
1 [C17:2] Balan, Wandering Knight
1 [C17:162] Behemoth Sledge
1 [C17:235] Blighted Woodland
1 [C17:50] Bloodforged Battle-Axe
1 [C17:237] Blossoming Sands
1 [C17:242] Command Tower
1 [C17:58] Condemn
1 [C17:146] Crushing Vines
1 [C17:147] Cultivate
1 [C17:30] Curse of Bounty
1 [C17:3] Curse of Vitality
1 [C17:59] Divine Reckoning
1 [C17:209] Dreamstone Hedron
1 [C17:247] Elfhame Palace
1 [C17:248] Evolving Wilds
1 [C17:172] Fleecemane Lion
1 [C17:212] Grappling Hook
1 [C17:252] Grasslands
1 [C17:253] Graypelt Refuge
1 [C17:51] Hammer of Nazahn
1 [C17:151] Harmonize
1 [C17:213] Hedron Archive
1 [C17:52] Heirloom Blade
1 [C17:53] Herald's Horn
1 [C17:214] Hero's Blade
1 [C17:31] Hungry Lynx
1 [C17:152] Hunter's Prowess
1 [C17:61] Jareth, Leonine Titan
1 [C17:62] Jazal Goldmane
1 [C17:153] Jedit Ojanen of Efrava
1 [C17:63] Kemba, Kha Regent
1 [C17:32] Kindred Summons
1 [C17:260] Krosan Verge
1 [C17:64] Leonin Arbiter
1 [C17:65] Leonin Relic-Warder
1 [C17:66] Leonin Shikari
1 [C17:215] Lightning Greaves
1 [C17:216] Loxodon Warhammer
1 [C17:181] Mirari's Wake
1 [C17:43] Mirri, Weatherlight Duelist
1 [C17:261] Mosswort Bridge
1 [C17:262] Myriad Landscape
1 [C17:44] Nazahn, Revered Bladesmith
1 [C17:155] Nissa's Pilgrimage
1 [C17:266] Opal Palace
1 [C17:68] Oreskos Explorer
1 [C17:56] Path of Ancestry
1 [C17:188] Phantom Nishoba
1 [C17:189] Qasali Pridemage
1 [C17:33] Qasali Slingers
1 [C17:220] Quietus Spike
1 [C17:69] Raksha Golden Cub
1 [C17:157] Relic Crush
1 [C17:272] Rogue's Passage
1 [C17:71] Rout
1 [C17:273] Saltcrusted Steppe
1 [C17:278] Secluded Steppe
1 [C17:72] Seht's Tiger
1 [C17:279] Selesnya Guildgate
1 [C17:280] Selesnya Sanctuary
1 [C17:222] Skullclamp
1 [C17:223] Sol Ring
1 [C17:158] Soul's Majesty
1 [C17:73] Spirit of the Hearth
1 [C17:224] Staff of Nin
1 [C17:281] Stirring Wildwood
1 [C17:75] Sunspear Shikari
1 [C17:226] Swiftfoot Boots
1 [C17:228] Sword of Vengeance
1 [C17:227] Sword of the Animist
1 [C17:77] Taj-Nar Swordsmith
1 [C17:284] Temple of the False God
1 [C17:159] Temur Sabertooth
1 [C17:285] Terramorphic Expanse
1 [C17:286] Tranquil Expanse
1 [C17:287] Tranquil Thicket
1 [C17:34] Traverse the Outlands
1 [C17:291] Vivid Grove
1 [C17:293] Vivid Meadow
1 [C17:78] White Sun's Zenith
1 [C17:79] Wing Shards
1 [C17:160] Zendikar Resurgent
2 [C17:307] Forest
2 [C17:308] Forest
2 [C17:309] Forest
2 [C17:295] Plains
2 [C17:296] Plains
3 [C17:297] Plains
SB: 1 [C17:35] Arahbo, Roar of the World

View file

@ -0,0 +1,94 @@
1 [C17:100] Blood Tribute
1 [C17:101] Bloodhusk Ritualist
1 [C17:102] Bloodlord of Vaasgoth
1 [C17:103] Butcher of Malakir
1 [C17:104] Captivating Vampire
1 [C17:105] Consuming Vapors
1 [C17:108] Damnable Pact
1 [C17:112] Drana, Kalastria Bloodchief
1 [C17:113] Falkenrath Noble
1 [C17:114] Go for the Throat
1 [C17:116] Malakir Bloodwitch
1 [C17:120] Pawn of Ulamog
1 [C17:122] Read the Bones
1 [C17:123] Sangromancer
1 [C17:124] Sanguine Bond
1 [C17:125] Skeletal Scrying
1 [C17:126] Skeletal Vampire
1 [C17:127] Syphon Mind
1 [C17:128] Underworld Connections
1 [C17:129] Vampire Nighthawk
1 [C17:130] Vein Drinker
1 [C17:139] Outpost Siege
1 [C17:140] Rakish Heir
1 [C17:14] Bloodline Necromancer
1 [C17:164] Blood Baron of Vizkopa
1 [C17:167] Crackling Doom
1 [C17:16] Curse of Disturbance
1 [C17:179] Merciless Eviction
1 [C17:17] Kheru Mind-Eater
1 [C17:182] Mortify
1 [C17:197] Stromkirk Captain
1 [C17:200] Tithe Drinker
1 [C17:204] Blade of the Bloodchief
1 [C17:205] Boros Signet
1 [C17:207] Darksteel Ingot
1 [C17:208] Door of Destinies
1 [C17:20] Patron of the Vein
1 [C17:218] Nihil Spellbomb
1 [C17:219] Orzhov Signet
1 [C17:221] Rakdos Signet
1 [C17:222] Skullclamp
1 [C17:223] Sol Ring
1 [C17:22] Bloodsworn Steward
1 [C17:231] Well of Lost Dreams
1 [C17:232] Worn Powerstone
1 [C17:233] Akoum Refuge
1 [C17:236] Bloodfell Caves
1 [C17:238] Bojuka Bog
1 [C17:239] Boros Garrison
1 [C17:23] Crimson Honor Guard
1 [C17:240] Boros Guildgate
1 [C17:241] Cinder Barrens
1 [C17:242] Command Tower
1 [C17:248] Evolving Wilds
1 [C17:250] Forsaken Sanctuary
1 [C17:259] Kabira Crossroads
1 [C17:25] Disrupt Decorum
1 [C17:265] Nomad Outpost
1 [C17:266] Opal Palace
1 [C17:268] Orzhov Basilica
1 [C17:269] Orzhov Guildgate
1 [C17:270] Rakdos Carnarium
1 [C17:271] Rakdos Guildgate
1 [C17:276] Scoured Barrens
1 [C17:27] Kindred Charge
1 [C17:282] Stone Quarry
1 [C17:285] Terramorphic Expanse
1 [C17:288] Urborg Volcano
1 [C17:294] Wind-Scarred Crag
1 [C17:295] Plains
1 [C17:296] Plains
1 [C17:297] Plains
1 [C17:305] Mountain
1 [C17:306] Mountain
1 [C17:3] Curse of Vitality
1 [C17:40] Licia, Sanguine Tribune
1 [C17:42] Mathas, Fiend Seeker
1 [C17:52] Heirloom Blade
1 [C17:56] Path of Ancestry
1 [C17:57] Blind Obedience
1 [C17:5] Kindred Boon
1 [C17:60] Fell the Mighty
1 [C17:70] Return to Dust
1 [C17:76] Swords to Plowshares
1 [C17:8] Teferi's Protection
1 [C17:95] Ambition's Cost
1 [C17:96] Anowon, the Ruin Sage
1 [C17:98] Black Market
1 [C17:99] Blood Artist
2 [C17:304] Mountain
3 [C17:301] Swamp
2 [C17:303] Swamp
3 [C17:302] Swamp
SB: 1 [C17:36] Edgar Markov

902
Utils/cut.pl Normal file
View file

@ -0,0 +1,902 @@
#!/usr/bin/perl
##
# File : get_all.pl
# Author : spjspj
##
use strict;
use LWP::Simple;
use POSIX qw(strftime);
# Main
{
if (scalar (@ARGV) < 4)
{
print ("Usage: cut.pl <file> <term> <helper> <operation>!\n");
print (" . File can be - list, STDIN, or an actual file\n");
print (" . Term can be - a regex you're looking for\n");
print (" . Operation can be - grep, filegrep, count, size, strip_http, matrix_flip(for converting ringing touches!), oneupcount, wget\n");
print (" . Helper is dependent on the operation you're doing. A number for grep will go +/- that amount \n");
print (" cut.pl bob.txt dave 5 grep\n");
print (" cut.pl all_java2.java TOKEN_STARTS_HERE TOKEN_ENDS_HERE grep_between\n");
print (" cut.pl full_text.txt keys 0 filegrep\n");
print (" cut.pl full_text.txt 0 0 make_code_bat\n");
print (" dir /a /b /s *.java | cut.pl stdin 0 0 make_code_bat > bob.bat\n");
print (" cut.pl d:\\perl_programs output.*txt 7 age_dir | cut.pl list . 0 grep\n");
print (" cut.pl bob.txt 0 0 uniquelines \n");
print (" cut.pl file 0 0 strip_http\n");
print (" cut.pl stdin \";;;\" \"1,2,3,4\" fields\n");
print (" cut.pl bob.txt 0 0 matrix_flip\n");
print (" cut.pl bob.txt 0 0 condense (Used for making similar lines in files smaller..)\n");
print (" cut.pl bob.txt 0 0 str_condense (Used for making similar lines in files smaller..)\n");
print (" cut.pl stdin \"http://bob.com/a=XXX.id\" 1000 oneupcount \n");
print (" cut.pl stdin \"http://www.comlaw.gov.au/Details/XXX\" 1000 wget\n");
print (" cut.pl stdin \"http://gatherer.wizards.com/Pages/Card/Details.aspx?multiverseid=XXX\" 5274 oneupcount\n");
print (" cut.pl stdin \"http://gatherer.wizards.com/Pages/Card/Details.aspx?multiverseid=XXX' 5274 wget\n");
print (" cut.pl modern_bluesa \";;;\" \"0,7\" fields | cut.pl stdin \";;;\" 3 wordcombos\n");
print (" cut.pl modern_bluesa \";;;\" \"0,7\" fields | cut.pl stdin 0 0 uniquewords\n");
print (" cut.pl modern_bluesa \";;;\" \"0,2\" images_html\n");
print (" cut.pl stdin start_ _end letters\n");
print (' echo "" | cut.pl stdin "http://www.slightlymagic.net/forum/viewtopic.php?f=70&t=4554&start=30" 0 wget');
print ("\n");
print (" cut.pl all_java.java \"\\\+\\\+\\\+\\\+\" \"extends token\" cut_on_first_display_with_second\n\n");
print ("\n");
print ('\necho "" | cut.pl stdin "http://www.slightlymagic.net/forum/viewtopic.php?f=70&t=14062&start=XXX" 400 oneupcount | cut.pl stdin "XXX" 400 wget\n');
print ("\n");
print ('\necho "" | cut.pl stdin "http://mythicspoiler.com/c17/cards/stalkingleonin.html" 0 wget_card_spoiler\n');
print ('dir /a /b /s *.jar | cut.pl stdin "^" "7z l -r \"" replace | cut.pl stdin "$" "\"" replace > d:\temp\xyz.bat');
print ("\n");
print ('echo "1" | cut.pl stdin "http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=16431&type=card" "6ED/Phantasmal Terrain.full.jpg" wget_image');
print ("\n");
exit 0;
}
my $file = $ARGV [0];
my $term = $ARGV [1];
my $helper = $ARGV [2];
my $operation = $ARGV [3];
my %combos;
my %all_combos;
my %dedup_line_hash;
my $in_between_lines = 0;
if ($file eq "list" && $operation ne "size")
{
while (<STDIN>)
{
chomp $_;
my $file = $_;
my $found_output = 0;
#print "==========\n";
#print "RUNNING: cut.pl $file $term $helper $operation \n";
open PROC, "cut.pl $file $term $helper $operation |";
while (<PROC>)
{
if ($found_output == 0)
{
print ("\n\n==================\nProcessing file: $file\n");
$found_output = 1;
}
print ($_);
}
if ($found_output > 0)
{
print ("\n******************xx\n");
}
close PROC;
}
exit;
}
if ($file eq "stdin")
{
open FILE, "-";
}
elsif ($operation eq "strip_http")
{
open FILE, "$file";
binmode (FILE);
}
elsif ($operation ne "age_dir")
{
open FILE, "$file";
}
else
{
}
my $current_file = '';
my $dot_current_file = '';
my $in_file = 0;
my $num_files = 0;
# size functions!
my $total_size = 0;
# OldGrep functions!
my %grep_past_lines;
my $grep_past_lines_index = 1;
my $grep_forward_lines = -1;
# Grep variables:
# Before and or after!
my $before = 0;
my $before_index = 0;
my $after = 0;
my $orig_after = 0;
my $after_index = 0;
my @before_lines;
my @after_lines;
# Grep variables:
# Check before all the time (from first line), but only checkafter after the first line is matched!
my $use_before = 0;
my $use_after = 0;
my $num_lines_after = 0;
if ($helper =~ m/^\d+$/)
{
$before = $helper;
$use_before = 1;
if ($helper eq "0")
{
$use_before = 0;
}
$after = 0;
$use_after = 1;
$orig_after = $helper;
}
elsif ($helper =~ m/^-\d+/)
{
$before = -1 * $helper;
$use_before = 1;
}
elsif ($helper =~ m/^\+\d+/)
{
$after = 0;
$orig_after = $helper;
$use_after = 1;
}
# Count functions!
my $count = 1;
my $seen_http = 0;
my $lines_http = 0;
my %matrix_flip;
my $matrix_row = 0;
my $matrix_col = 0;
my $max_matrix_col = 0;
my $condense_begin = 1;
my $condense_line = "";
my $condense_start = "";
my $condense_regex = "";
my $condense_count = 0;
if ($operation eq "oneupcount")
{
my $i = 0;
for ($i = 0; $i < $helper; $i ++)
{
my $l = $term;
$l =~ s/XXX/$i/;
print ("$l\n");
}
exit;
}
if ($operation eq "wget_seed")
{
my $i;
for ($i = 10; $i < $helper + 10; $i++)
{
my $url = $term;
$url = "http://gatherer.wizards.com/Pages/Card/Details.aspx?action=random";
my $content = get $url;
$content =~ s/\s\s/ /gim;
$content =~ s/\s\s/ /gim;
$content =~ s/\n//gim;
$content =~ s/.*multiverseid=(\d+).*/$1/gim;
print "$content\n";
}
}
my %kkks;
if ($operation eq "filegrep")
{
open KEYS, "$term";
while (<KEYS>)
{
chomp;
$kkks {"^$_"} = 1;
}
}
if ($operation eq "make_code_bat")
{
print ("\@echo off\n");
}
my %ulines;
my $ulines_count = 0;
my @cut_on_term;
my $saw_helper_cut_on_term = 0;
while (<FILE>)
{
chomp $_;
my $line = $_;
if ($operation eq "grepold")
{
if ($line !~ m/$term/i && $grep_forward_lines < 0)
{
$grep_past_lines {$grep_past_lines_index} = $line;
$grep_past_lines_index ++;
if ($grep_past_lines_index > $helper)
{
$grep_past_lines_index = 1;
}
}
elsif ($line =~ m/$term/i)
{
my $i = $grep_past_lines_index;
if (defined ($grep_past_lines {$i}))
{
print $grep_past_lines {$i}, " --- 22222\n";
}
$i++;
if ($i > $helper) { $i = 1; }
while ($i != $grep_past_lines_index)
{
if (defined ($grep_past_lines {$i}))
{
print $grep_past_lines {$i}, " --- 33333\n";
}
$i ++;
if ($i > $helper) { $i = 1; }
}
print "\n", $line, "\n";
my %new_hash;
%grep_past_lines = %new_hash;
$grep_past_lines_index = 1;
$grep_forward_lines = $helper + 1;
}
if ($grep_forward_lines <= $helper && $grep_forward_lines > 0)
{
print $line, " --- 44444\n";
}
$grep_forward_lines--;
if ($grep_forward_lines == 0)
{
print "\n";
}
}
if ($operation eq "wget")
{
my $i;
{
my $url = $term;
$url =~ s/XXX/$line/;
print ("Looking at :$url:\n");
my $content = get $url;
die "Couldn't get $url" unless defined $content;
$content =~ s/\s\s/ /gim;
$content =~ s/\s\s/ /gim;
$content =~ s/\n//gim;
print $url, "\n\n\n\n\n", "=================\n", $content, "============\n";
}
}
if ($operation eq "wget_card_spoiler")
{
my $i;
{
my $url = $term;
$url =~ s/XXX/$line/;
my $content = get $url;
die "Couldn't get $url" unless defined $content;
$content =~ s/\s\s/ /gim;
$content =~ s/\s\s/ /gim;
$content =~ s/\n//gim;
$content =~ s/^.*CARD NAME-*->/CARD NAME-->/gim;
$content =~ s/<!-*-END CARD.*$//gim;
# Example: <!--CARD NAME-->Licia, Sanguine Tribune </font></td></tr><tr><td colspan="2" valign="top"> <!--MANA COST--> 5RWB </td></tr><tr><td colspan="2" valign="top"> <!--TYPE--> Legendary Creature - Vampire Soldier </td></tr><tr><td colspan="2" valign="top"> <!--CARD TEXT--> Licia, Sanguine Tribune costs 1 less to cast for each 1 life you gained this turn. <br><br> First strike, lifelink <br><br> Pay 5 life: Put three +1/+1 counters on Licia. Activate this ability only on your turn and only once each turn. </td></tr><tr><td colspan="2" valign="top"><i> <!--FLAVOR TEXT--> "I give my blood, my life, all I have in exchange for victory." </i></td></tr><tr><td colspan="2" valign="top"></td></tr><tr><td width="210" valign="bottom"><font size="1"> <!--ILLUS--> Illus. Magali Villeneuve <!--Set Number--><i> </i></font></td><td valign="bottom" align="left"><font size="2"> <!--P/T--> 4/4 <!--END CARD TEXT--><!--END CARD TEXT--><!--END CARD TEXT--><!--END CARD TEXT--><!--END CARD TEXT--><!--END CARD TEXT-->
# >>> Duelist's Heritage|Commander 2016|1|R|{2}{W}|Enchantment|||Whenever one or more creatures attack, you may have target attacking creature gain double strike until end of turn.|
$content =~ m/.*CARD NAME-*-> *(.*?) *</im;
my $card_name = $1;
$content =~ m/.*MANA COST-*->(.*?)</im;
my $mana_cost = $1;
$mana_cost =~ s/ //gim;
$mana_cost =~ s/(.)/{$1}/gim;
$content =~ m/.*TYPE-*->(.*?)</im;
my $type = $1;
$content =~ m/.*TEXT-*->(.*?)<!-*-FLAVOR/im;
my $text = $1;
$text =~ s/<br[ \/]*?>/\$/img;
$text =~ s/\$ *\$/\$/img;
$text =~ s/<[^>]+>//img;
$text =~ s/[\$ ]*$//img;
$content =~ m/.*P\/T-*-> *(.*?) *\/ *(.*?) *(<|$)/im;
my $p = $1;
my $t = $2;
print ("$card_name|Commander 2017|??|CURM|$mana_cost|$type|$p|$t|$text|\n");
}
}
if ($operation eq "wget_image")
{
my $i;
{
my $url = $term;
print ("Download :$url:\n");
my $content = get $url;
print ("Saw " . length ($content) . " bytes!\n");
print ("Save in $helper\n");
open OUTPUT, "> " . $helper or die "No dice!";
binmode (OUTPUT);
print OUTPUT $content;
close OUTPUT;
print $url, " >>> ", $helper, "\n";
}
}
if ($operation eq "grep")
{
if ($line !~ m/$term/i && $use_after && $after > 0)
{
print ($line, "\n");
$after--;
if ($after == 0)
{
print ("aaa===================\n");
}
}
if ($line !~ m/$term/i && $use_before)
{
$before_lines [$before_index] = $line;
#print (" >>>> adding in $before_index ($line)\n");
#print (join (',,,', @before_lines));
#print ("\n");
$before_index ++;
if ($before_index >= $before)
{
$before_index = 0;
}
}
if ($line =~ m/$term/i)
{
if ($use_before)
{
#print ("bbb===================\n");
my $b = $before_index;
my $ok_once = 1;
while ($b != $before_index || $ok_once)
{
if (defined ($before_lines [$b]))
{
#print ("bbb" , $before_lines [$b], "\n");#.($b, .$before. $before_index, $ok_once).\n");
print ($before_lines [$b], "\n");#.($b, .$before. $before_index, $ok_once).\n");
}
$ok_once = 0;
if ($b >= $before - 1)
{
$b = -1;
}
$b++;
}
my @new_array;
@before_lines = @new_array;
}
print ("$line\n");
if ($use_after)
{
$after = $orig_after;
}
}
}
if ($operation eq "grep_between")
{
if ($line =~ m/$term/i)
{
print ("\n===================================================================\n");
print ($line, "\n");
$in_between_lines = 1;
}
if ($line !~ m/$helper/i && $in_between_lines)
{
print ($line, "\n");
}
if ($line =~ m/$helper/i && $in_between_lines)
{
print ($line, "\n");
$in_between_lines = 0;
}
}
if ($operation eq "filegrep")
{
my $k;
my $print = 1;
foreach $k (keys (%kkks))
{
if ($line =~ m/$k/ && $print)
{
$print = 0;
print ($line, "\n");
}
}
}
if ($operation eq "size")
{
if (-f $line)
{
my $sizer = -s $line;
my $zzz = " $sizer";
$zzz =~ s/.*(........................)$/$1/;
print ($zzz, " --- $line\n");
$total_size += $sizer;
}
}
if ($operation eq "count")
{
print ("$count - $line\n");
$count++;
}
if ($operation eq "strip_http")
{
# Has to work on a file..
if ($line =~ m/.*HTTP/)
{
$seen_http = 1;
print ("SEEN HTTP\n");
}
#print (">>$line<<\n");
$lines_http ++;
if ($seen_http && $line eq "")
{
$seen_http = 2;
}
}
if ($operation eq "replace")
{
my $orig_line = $line;
$line =~ s/$term/$helper/gi;
if ($helper =~ m/\\n/)
{
$line =~ s/\\n/\n/gi;
}
if ($helper =~ m/''/)
{
$line =~ s/''/"/gi;
}
print ("$line\n");
eval("\$orig_line =~ s/$term/$helper/gi;");
#print ("$orig_line\n");
}
if ($operation eq "dedup_line")
{
$line =~ m/::(.*)::/;
my $user = $1;
my $new_line;
$line =~ s/.*://;
while ($line =~ s/,([^,]*),/,/im)
{
$new_line .= "\n$user:$1\n";
if (not defined ($dedup_line_hash {"$user:$1"}))
{
$dedup_line_hash {"$user:$1"} = 1;
$dedup_line_hash {$user} ++;
}
}
print ("$new_line\n");
}
if ($operation eq "matrix_flip")
{
my @chars = split //, $line;
$matrix_col = 0;
my $char;
foreach $char (@chars)
{
$matrix_flip {"$matrix_row,$matrix_col"} = $char;
$matrix_col ++;
if ($max_matrix_col < $matrix_col)
{
$max_matrix_col = $matrix_col;
}
}
$matrix_row ++;
}
if ($operation eq "str_condense")
{
if ($line =~ m/(.)(\1{3,})/)
{
$line =~ s/(.)(\1{3,})/sprintf ("$1!%d#", length ($2));/eg;
}
print $line, "\n";
}
if ($operation eq "condense")
{
if ($condense_begin == 1)
{
#print (" begin........... $line \n");
$condense_begin = 0;
$condense_line = $line;
$condense_start = $line;
$condense_start =~ s/^(.{10,25}).*/$1/;
$condense_start =~ s/\W/./g;
$condense_count = 0;
}
else
{
if ($line =~ $condense_start)
{
#print (" similar........... $line \n");
$condense_count++;
}
else
{
if ($condense_count > 1)
{
$condense_line .= " {+similar=$condense_count}";
}
print $condense_line, "\n";
$condense_line = $line;
if ($condense_line !~ m/......./)
{
$condense_begin = 1;
}
else
{
$condense_start = $line;
$condense_start =~ s/^(.{10,25}).*/$1/;
$condense_start =~ s/\W/./g;
$condense_count = 0;
}
}
}
}
if ($operation eq "fields")
{
#$line = "BBB$term$line$term";
my @fs = split /$term/, $line;
my @shows = split /,/, "$helper,";
my $s;
foreach $s (@shows)
{
if ($s eq "Rest")
{
print $line;
}
elsif ($s eq "NewLine")
{
print "\n";
}
else
{
print $fs [$s], "$term";
}
}
print "\n";
}
if ($operation eq "wordcombos")
{
my @fs = split /$term/, $line;
# The first one is key, the rest need to be made into something
my $current_key = $fs [0];
my $current_val = $fs [1];
$current_val =~ s/ /XXX/g;
$current_val =~ s/\W//g;
$current_val =~ s/XXX*/ /g;
#print $current_key , " ---- ", $current_val, "\n";
my @words = split / /, uc ($current_val);
my $w;
my $ws;
for ($w = 0; $w < scalar (@words); $w++)
{
my $x;
$ws = $words [$w];
for ($x = $w + 1; $x < $w + $helper; $x++)
{
$ws .= "," . $words [$x];
}
#$ws .= ";;;" . $current_key;
$combos {$ws} ++;
$all_combos {$ws} .= ";;;" . $current_key;
}
}
if ($operation eq "uniquewords")
{
$line .= " ";
my @words = split / /, uc ($line);
my $w;
my $ws;
for ($w = 0; $w < scalar (@words); $w++)
{
$combos {$words [$w]} ++;
}
}
if ($operation eq "cut_on_first_display_with_second")
{
if ($line =~ m/$helper/img) # cut_on_term
{
if ($saw_helper_cut_on_term)
{
print join ("\n", @cut_on_term);
}
else
{
#print ("\nNothing in this segment!!\n");
}
$saw_helper_cut_on_term = 0;
my @new_array;
@cut_on_term = @new_array;
}
push @cut_on_term, $line;
if ($line =~ m/$term/img)
{
$saw_helper_cut_on_term = 1;
}
}
if ($operation eq "images_html")
{
my @fs = split /$term/, $line;
my @shows = split /,/, "$helper,";
my $s;
{
# <img src='http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=220251&type=card'/>
if ($fs[$shows[0]] =~ m/\*/)
{
my $id = $fs[$shows[0]];
$id =~ s/\*//g;
$id =~ s/ //g;
my $x = "<img src='http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=XXX&type=card'/>";
$x =~ s/XXX/$id/;
print "$fs[$shows[1]]<br>$x";
print "\n";
}
}
}
if ($operation eq "make_code_bat")
{
if ($line !~ m/all_/img)
{
print ("echo \" $line +++++++\"\n");
print ("type \"$line\"\n");
}
}
if ($operation eq "uniquelines")
{
if (!defined ($ulines {$line}))
{
$ulines {$line} = 1;
$ulines_count ++;
print $line, "\n";
#print "xxx $ulines_count\n";
}
}
if ($operation eq "countlines")
{
$ulines {$line} ++;
}
}
if ($operation eq "age_dir2")
{
opendir DIR, $file or die "cannot open dir $file: $!";
print $file, "\n";
my $nextFile;
foreach $nextFile (grep {-f && ($helper > -M)} readdir DIR)
{
#print $nextFile, " -- $helper - ", -M, "\n";
if ($nextFile =~ m/$term/)
{
print "type $nextFile\n";
}
}
}
if ($operation eq "age_dir")
{
my $i;
my $cmd = "type ";
my $next_term = $term;
for ($i = 0; $i < $helper; $i++)
{
$next_term = $term;
my $now = time();
my $yyyymmdd = strftime "%Y%m%d", localtime($now - $i * 24*3600);
$next_term =~ s/YYYYMMDD/$yyyymmdd/;
$cmd .= " $next_term ";
}
print $cmd;
}
if ($operation eq "matrix_flip")
{
my $i;
my $j;
{
for ($i = 0; $i < $max_matrix_col; $i++)
{
for ($j = 0; $j < $matrix_row; $j++)
{
print ($matrix_flip {"$j,$i"});
}
print ("\n");
}
}
}
if ($operation eq "size")
{
print ($total_size, " --- Cumulative total\n");
}
close FILE;
if ($operation eq "strip_http")
{
if ($seen_http == 2)
{
`tail +$lines_http > /tmp/_cut_file; chmod 777 /tmp/_cut_file`;
`mv /tmp/_cut_file $file`;
}
}
if ($operation eq "condense")
{
if ($condense_count > 1)
{
$condense_line .= " {+similar=$condense_count}";
}
print $condense_line, "\n";
}
if ($operation eq "wordcombos")
{
my $v;
my @keys = keys (%combos);
my @new_keys;
my $v = 0;
my $k;
foreach $k (@keys)
{
if ($k =~ m/,,/) { next; }
#if ($k !~ m/WHENEVER/) { next; }
#if ($combos {$k} > 10)
{
#push @new_keys, $combos {$k}; # . " ---- " . $k . ",,," . $all_combos {$k};
push @new_keys, $k;
}
$v ++;
}
my @jjs = sort @new_keys;
foreach $k (sort @jjs)
{
print $k, "\n";
}
}
if ($operation eq "dedup_line")
{
my $k;
for $k (sort keys (%dedup_line_hash))
{
if ($k !~ m/.*:.*/)
{
print ("$k ---> $dedup_line_hash{$k}\n");
}
if ($k =~ m/(.*):(.*)\s*$/)
{
if ($dedup_line_hash{$1} > 7)
{
print ("/h $2\n");
}
}
}
}
if ($operation eq "uniquewords")
{
my $v;
my @keys = keys (%combos);
my @new_keys;
my $v = 0;
my $k;
my $i = 0;
foreach $k (@keys)
{
$i ++;
print $combos {$k}, "; $k\n";
}
}
if ($operation eq "countlines")
{
my $line;
#foreach $line (sort {$a <=> $b} values %ulines)
foreach $line (sort { $ulines{$a} <=> $ulines{$b} } keys %ulines)
{
print ("$ulines{$line} ==== $line\n");
}
}
if ($operation eq "letters")
{
#open PROC, "cut.pl $file $term $helper $operation |";
my %as;
$as {"A"} = 1;
$as {"B"} = 1;
$as {"C"} = 1;
$as {"D"} = 1;
$as {"E"} = 1;
$as {"F"} = 1;
$as {"G"} = 1;
$as {"H"} = 1;
$as {"I"} = 1;
$as {"J"} = 1;
$as {"K"} = 1;
$as {"L"} = 1;
$as {"M"} = 1;
$as {"N"} = 1;
$as {"O"} = 1;
$as {"P"} = 1;
$as {"Q"} = 1;
$as {"R"} = 1;
$as {"S"} = 1;
$as {"T"} = 1;
$as {"U"} = 1;
$as {"V"} = 1;
$as {"W"} = 1;
$as {"X"} = 1;
$as {"Y"} = 1;
$as {"Z"} = 1;
my $k;
foreach $k (sort keys (%as))
{
my $k2;
foreach $k2 (sort keys (%as))
{
print "$term$k$k2$helper\n";
}
}
}
}

View file

@ -0,0 +1,16 @@
del x
del x2
del x3
del x4
del x5
del x6
del x7.bat
echo "" | cut.pl stdin "http://mythicspoiler.com/ixa/" 0 wget > x
type x | cut.pl stdin "cards\/" "\n\n\ncards/" replace > x2
type x2 | cut.pl stdin "^" "\nhttp://mythicspoiler.com/ixa/" replace > x3
find x3 "http://mythicspoiler.com/ixa/" | find /v /i "jpg" > x4
type x4 | cut.pl stdin "><.*" "" replace > x5
type x5 | cut.pl stdin "^" "echo '''' | cut.pl stdin ''" replace > x6
echo @echo off > x7.bat
type x6 | cut.pl stdin "$" " 0 wget_card_spoiler" replace | cut.pl stdin 0 0 uniquelines | find /I "cards" >> x7.bat
type x7.bat