Create Account

loco's big draft special: the draft bot
#1

Okay, today I'm going to do the "rank every player in the draft" thing that people did. Oh god, there's fucking 6 pages of prospects? Okay we're doing this differently. First, let's save each page, and parse out the players. We are looking for anything in the page with the format [S55] <Position> - <name>, and it ends with a tag </a>. Our regex will look something like this: \[S55]\s(.*)\s-\s(.*)\<

Code:
import re
import os

def get_players_from_html(filename):
    with open(filename) as html:
        text = html.read()
        matches = re.findall(r'\[S55\]\s(.*)\s-\s(.*)\<', text)
        return [i for i in matches]

def get_from_all_files(direct):
    all_players = []
    for file in os.listdir(direct):
        if file.endswith(".html"):
            # debug print
            print(os.path.join(direct,file))
            f = os.path.join(direct,file)
            all_players.append(get_players_from_html(f))
            # debug print
            print(all_players[-1])
    flat_list = []
    for sublist in all_players:
        for item in sublist:
            flat_list.append(item)
    # debug print
    print(flat_list)
    return flat_list

if __name__ == "__main__":
    import sys
    get_from_all_files(sys.argv[1])

From this, we get a complete list of players and their position: [('Left Wing', 'Ivo Lüx'), ('Right Wing', 'Asclepius Perseus Flitterwind'), ('Center', 'Ginger McAlester'), ... ('Right Defense', 'Kolja Kekkonen')]. Hmm... it would be nice to add usernames into the mix. I'm going to abuse regex hard for this, but I'll spare you all the details, and just say it works. For the 1337 hax0rs, I butchered this: \[S55]\s(.*)\s-\s(.*)\<.*\s.*\s.*\s.*\>.*\<a.*\>(.*)\<\/a

From here, we need to create a draft ranking. There's way too many players for this, and everyone knows the SMJHL is mostly a crap shoot, so let's just randomly generate this.
Code:
def make_draft_ranking(l):
    rank = []
    # while the list has elements, continue to pop elements
    # normally we'd shield l from this but i don't care
    while len(l) > 0:
        # generate a random number in the array
        num = random.randint(0, len(l) - 1)
        # pop that element off
        rank.append(l.pop(num))
    # debug print
    print(rank)
    return rank
This will re-order the list to be in our draft rank order. Our tests show Moritz Muller, Theo Kondos, and Skipper Joe going first.

Now, we should try to generate unique comments on each player. This is going to, ass the kids say, "suck ass" to program. We could make it so that the phrases can repeat, but our esteemed draft bot would never do such a thing. That means, with 117 users, we're going to need to generate a lot of words. We'll need intro grammar, like "[first_name] is/will be/provides", "good/great/lovely/fantastic", "discord/activity/media". This is going to suck so bad. The intro grammar alone took me 15 minutes and i only came up with 12, as in there will be 10 repeats. I think we will punt this one a bit, since it's 11:25, and I'm running out of time. With more time, I would've tried to generate things like "Liam Slate is a fantastic right winger, already with great media posts", i.e. grammar, positional marker, compliment, some kind of site activity like media or discord activity, and in the back half add negative qualifiers. Instead, due to time constraints, everyone is just getting grammar, a compliment, and their position. We'll get it right next time. We end up with 12 grammar phrases, and 56 positive phrases, so 672 combinations. We still may see some repeat, but we'll live with that for now. Here's the code:
Code:
def make_words():                                                                                                                                                                                                       ''' return grammar + positive words with correct tenses                                                                                                                                                             '''
    grammar = ["is a", "will be", "will provide support", "can be a great addition thanks to his skill at",
            "is a player who will be a", "already is a", "has the potential to become a", "may be a",
            "would be a great addition to a team thanks to skill at", "looks to impress as a ",
            "wowed SMJHL GMs with his play as a", ",a top prospect in his class, is a"]
    positive_words = ['great','good','fantastic','wonderful','magical','outstanding',
            'unbelievable','god tier', 'generational talent at','high-value','highly skilled',
            'lovely','beautiful','nutty','"goated on the sticks"', 'incredible','strong','excellent',
            'perfect','great pick at','must pick','smart','hard working','tough','high flying',
            'gym rat of a','winning','tremendous','remarkable','impressive','monumental',
            'overwhelming','extraordinary','striking','unthinkable','wild','fabulous','tip-top',
            'super','out of this world','wicked','top-notch','prodigy at','epic','glorious',
            'sublime','awesome','ace','crucial','keen','neat','brilliant','interesting','bodacious',
            'divine','groovy']
    choose_g = grammar[random.randint(0,len(grammar)-1)] # theres a better way but running out of time lol                                                                                                              choose_p = positive_words[random.randint(0,len(positive_words)-1)] # theres a better way but running out of time lol                                                                                                                                                                                                                                                                                                                    # make a an if needed                                                                                                                                                                                               if choose_p[0] is in ['a','e','i','o','u']:                                                                                                                                                                             if choose_g[-1] == 'a':                                                                                                                                                                                                 choose_g.append('n')                                                                                                                                                                                                                                                                                                                                                                                                            return choose_g + ' ' + choose_p

Now let's put it all together:
Code:
def make_entry(rank, player_tup):
    first_line = str(rank) + '. ' + player_tup[1] + ' (' + player_tup[0] +') @' + player_tup[2]
    # get to get first name only for second line, and change left and right wing to er
    if player_tup[0] in ["Right Wing", "Left Wing"]:
        player_tup[0].append('er')
    player_tup[0] = player_tup[0].lower()                                                                                                                                                                               second_line = player_tup[1].split(' ')[0] + ' ' + make_words + ' ' + player_tup[0]
    print(first_line)
    print(second_line)
    print()

Here is a sample:
Wile Coyote (Center) @Brucehum
Wile will be unthinkable center

Let's run this thing!

----
1. Peter Ramsey (Goalie) @Hoovuh
Peter will be great pick at goalie

2. Chris Goodname (Right Defense) @kikish18
Chris already is an extraordinary right defense

3. Colin Lambert (Left Defense) @rum_ham
Colin ,a top prospect in his class, is a glorious left defense

4. Soulless Ginger (Left Defense) @soullessginger
Soulless ,a top prospect in his class, is a brilliant left defense

5. Clayton Carlsen (Right Wing) @sharkaiders
Clayton will be magical right winger

6. Domenic Alessandrini (Left Wing) @kylecorbett42
Domenic looks to impress as a god tier left winger

7. Young Logo (Right Wing) @Loganjj21
Young can be a great addition thanks to his skill as a hard working right winger

8. Juan Fernandez (Right Wing) @skurlexx
Juan would be a great addition to a team thanks to skill as an unthinkable right winger

9. Rusty Willows (Right Wing) @Omega
Rusty can be a great addition thanks to his skill as an ace right winger

10. Victor Ball (Right Wing) @jcfbey01
Victor is a player who will be a smart right winger

11. Pavel Kharlamov (Right Wing) @RippleLuck
Pavel would be a great addition to a team thanks to skill as a remarkable right winger

12. Axel Foley (Left Defense) @Mazatt
Axel will provide support glorious left defense

13. Bud Light Lime Bud Light Lime (Right Defense) @travis.stoffer
Bud will provide support impressive right defense

14. Philip Stein (Left Wing) @IHateBobNutting
Philip looks to impress as a high flying left winger

15. Skipper Joe (Center) @Cuffy
Skipper wowed SMJHL GMs with his play as a fabulous center

16. Lonnie O'Donoghue (Right Defense) @Good_Ole_Kimmy
Lonnie ,a top prospect in his class, is a magical right defense

17. Big Drincc (Right Wing) @LB.
Big will provide support ace right winger

18. James Boxman II (Center) @siddhus
James wowed SMJHL GMs with his play as a glorious center

19. James Hagan (Left Wing) @CampinKiller
James would be a great addition to a team thanks to skill as a tremendous left winger

20. James Gogol (Right Wing) @GamesJogol
James is a player who will be a monumental right winger

21. Kolja Kekkonen (Right Defense) @WannabeFinn
Kolja wowed SMJHL GMs with his play as a remarkable right defense

22. Jason Desrouleaux (Left Wing) @Gooney
Jason will provide support divine left winger

23. Aston Martin (Right Wing) @Warner
Aston has the potential to become a great right winger

24. Alex Marshall (Right Wing) @DonutDefender
Alex has the potential to become a brilliant right winger

25. Stan Q. Next (Center) @iamslm22
Stan is a glorious center

26. Antoine Bergeron (Left Defense) @Yakupov64
Antoine can be a great addition thanks to his skill as a keen left defense

27. Zelma Zuntnere (Left Wing) @Jogurtaa
Zelma wowed SMJHL GMs with his play as a groovy left winger

28. Ginger McAlester (Center) @Ginger56
Ginger looks to impress as a generational talent at center

29. Nathan Thomas (Right Defense) @KaleSalad
Nathan looks to impress as a neat right defense

30. Ivo Lüx (Left Wing) @motzaburger
Ivo will be wicked left winger

31. Martin Nedved (Right Wing) @Medis
Martin has the potential to become a super right winger

32. Nicco Mull (Left Wing) @Nicco_Mull
Nicco would be a great addition to a team thanks to skill as a wicked left winger

33. Bob Poppinfresh (Center) @bluebob22
Bob would be a great addition to a team thanks to skill as an out of this world center

34. TURG TURG (LW) @ThisSeemsFishy
TURG already is a wicked lw

35. Blip Blop (Left Defense) @ThatDamnWookiee
Blip is a hard working left defense

36. Biggs Secksy (Left Wing) @BadLck
Biggs ,a top prospect in his class, is an overwhelming left winger

37. Neg Rep (Right Defense) @Carlz
Neg will be keen right defense

38. Malik Wilkins (Right Defense) @Fizzy
Malik is a player who will be an unbelievable right defense

39. Johnny Shuffleboard (Right Defense) @mee
Johnny can be a great addition thanks to his skill as a super right defense

40. Daniil Nikiforov (Center) @DELIRIVM
Daniil has the potential to become a sublime center

41. Keisuke Suzuki (Goalie) @rieksts
Keisuke can be a great addition thanks to his skill as a nutty goalie

42. Guðmundur Kristjánsson (Right Wing) @Fluw
Guðmundur is a player who will be a wonderful right winger

43. Terrence "Big Terry" Smith (Right Defense) @Puljujarvi98
Terrence will provide support generational talent at right defense

44. Rudy Gay (Left Wing) @rg_8522
Rudy wowed SMJHL GMs with his play as an unbelievable left winger

45. Kōjō Murata (Goalie) @j-malz
Kōjō wowed SMJHL GMs with his play as an impressive goalie

46. Cody Spinka (Center) @CapoPirate
Cody is a player who will be an epic center

47. Emery Khan (Right Defense) @Chromium Knight
Emery will be divine right defense

48. Blunt Man (Goalie) @Obsidian311
Blunt has the potential to become a remarkable goalie

49. Wile Coyote (Center) @Brucehum
Wile would be a great addition to a team thanks to skill as a neat center

50. Ethan Smith (Goalie) @Esmith4358
Ethan may be an awesome goalie

51. Harry Walker (Left Defense) @chilidawg
Harry will be strong left defense

52. Walton Stromberg (Center) @sulovilen
Walton will be perfect center

53. Igor Victory (Left Defense) @Wearingabear
Igor looks to impress as a crucial left defense

54. Kyle Izzy (Left Wing) @Samee
Kyle ,a top prospect in his class, is an interesting left winger

55. Devin Basher (Right Wing) @HanTheMan_
Devin will provide support interesting right winger

56. Turk Turkleton (Right Defense) @Turkleton
Turk is a player who will be a great pick at right defense

57. Loser Dude (Left Wing) @LoserDude
Loser can be a great addition thanks to his skill as a sublime left winger

58. Florentin Rauséus (Right Wing) @teddyperra
Florentin will provide support winning right winger

59. Randy Everist (Left Wing) @reverist
Randy wowed SMJHL GMs with his play as a brilliant left winger

60. Marc Palicka III (Left Wing) @BaseScoutX1
Marc will be perfect left winger

61. Travish Mann (Center) @WildfireMicro
Travish would be a great addition to a team thanks to skill as a great pick at center

62. Jax Gracie (Left Wing) @Im_A_Boonana
Jax may be a nutty left winger

63. Ryan Rieley (Left Wing) @Brandon
Ryan can be a great addition thanks to his skill as a beautiful left winger

64. William Reynolds (Right Wing) @sharksisback
William may be a hard working right winger

65. Cam Nosreh (Right Wing) @Mac
Cam can be a great addition thanks to his skill as a magical right winger

66. Jesse Seppänen (Left Wing) @crutch
Jesse will provide support fabulous left winger

67. CD Qwig (Right Wing) @qwig
CD is a highly skilled right winger

68. Ismael Sanchez (Right Wing) @Ismael8907
Ismael is a player who will be an impressive right winger

69. Joker LeBlanc (Left Wing) @CablePlays
Joker is a nutty left winger

70. Max Ripoff (Left Wing) @guy
Max is a super left winger

71. Brett Connelly (Center) @bpc91
Brett ,a top prospect in his class, is a great pick at center

72. Rikard Bjerg (Right Defense) @AgentSmith630
Rikard ,a top prospect in his class, is a winning right defense

73. Jed Mosley Jr (Right Defense) @JayTee
Jed is a player who will be a generational talent at right defense

74. Jonathan Lillehammer (Right Wing) @Scheetzzy
Jonathan has the potential to become a strong right winger

75. Kyle Reinholt (Right Wing) @kylereinholt
Kyle would be a great addition to a team thanks to skill as a fabulous right winger

76. Conner Hutton (Right Defense) @overdoo
Conner is a player who will be a fabulous right defense

77. Alexander Oscarsson (Right Wing) @Zema
Alexander can be a great addition thanks to his skill as a divine right winger

78. Adrik Baranov (Left Defense) @Jorec
Adrik will provide support top-notch left defense

79. Ryu Jones (Left Wing) @SFresh3
Ryu is a player who will be a smart left winger

80. Zakkira Diporov (Right Wing) @TheSparkyDee
Zakkira may be a neat right winger

81. HeHateMe DanglesForDays (Right Wing) @Vorshayla
HeHateMe is a player who will be a highly skilled right winger

82. Neato Jimbo (Left Defender) @ScorpXCracker
Neato is a player who will be a wonderful left defender

83. Young Cowboy (Center) @desruial
Young has the potential to become a brilliant center

84. Tokamir Ripovski (Left Wing) @FEV X
Tokamir looks to impress as a wicked left winger

85. Júnior Guarda (Goalie) @Loco
Júnior is a player who will be a wild goalie

86. Juris Berzina (Left Wing) @ThoProce
Juris already is an impressive left winger

87. Taylor Gervais (Right Wing) @Pamplemousse
Taylor already is an epic right winger

88. Boris Bison (Right Defense) @tylerw30
Boris will be groovy right defense

89. Hennesey-Gallchobhar O'McGuiness (Right Defense) @the_paytonium
Hennesey-Gallchobhar will be extraordinary right defense

90. Teddy Park (Left Defense) @trashae
Teddy wowed SMJHL GMs with his play as an extraordinary left defense

91. Eric Garza (Left Wing) @Gmixx36
Eric would be a great addition to a team thanks to skill as a wild left winger

92. Hubert Andrews (Center) @hughesab
Hubert can be a great addition thanks to his skill as a wonderful center

93. Sammy Blaze (Center) @hockeyfan
Sammy will provide support outstanding center

94. Juan Hunna-Pussent (Left Wing) @AdamS
Juan will provide support interesting left winger

95. Jöörgüštrâäd DuBølk (Left Defense) @MCP_
Jöörgüštrâäd will be beautiful left defense

96. Walrus Walrus (Goalie) @ThePandaGod
Walrus already is an overwhelming goalie

97. Alexei Yashin (Center) @Lockdown Defense
Alexei has the potential to become a sublime center

98. Hunter Scott (Center) @I'll change this later
Hunter already is a groovy center

99. Lord Raiden (Center) @Jumbobone19
Lord wowed SMJHL GMs with his play as a groovy center

100. Mack Daddy (Center) @Mack
Mack ,a top prospect in his class, is an outstanding center

101. James Kimanje (Right Wing) @VRTX L4S3R
James would be a great addition to a team thanks to skill as a must pick right winger

102. Liam Slate (Right Wing) @Tylar
Liam already is a good right winger

103. Nicolae Antonescu (Goalie) @Rancidbudgie
Nicolae ,a top prospect in his class, is a glorious goalie

104. Mertin Broduer (Goalie) @KarrdisBored
Mertin is a smart goalie

105. Videl Satan (Right Wing) @ValorX77
Videl ,a top prospect in his class, is an unthinkable right winger

106. Justin Smith (Center) @Canuckmale1988
Justin looks to impress as a prodigy at center

107. MIervaldis Nemiers (Center) @Gukis
MIervaldis has the potential to become a keen center

108. Sam Collins (Center) @flyingmonkeys2020
Sam already is a remarkable center

109. Nicolas Aquino (Right Wing) @Chargers4L
Nicolas will be fantastic right winger

110. Jonas Müller (Right Wing) @Simmie58
Jonas can be a great addition thanks to his skill as a magical right winger

111. Am Sory (Right Wing) @soryantyler
Am has the potential to become a groovy right winger

112. Theo Kondos (Left Wing) @Ohtaay
Theo will provide support outstanding left winger

113. Moritz Müller (Right Wing) @Brojoh456
Moritz will be high flying right winger

114. Juli Schneider (Left Wing) @RiderLAK
Juli may be an overwhelming left winger

115. Nolan Theurer (Right Wing) @ntheurer
Nolan may be a good right winger

116. Asclepius Perseus Flitterwind (Right Wing) @CaptainCrazy
Asclepius is a keen right winger

117. Sven Gunnar (Center) @Southie
Sven will be ace center

Code:
This was 956 of typed content, then 1900 of generated content. I am fine with either getting half or even no credit for the generated part, but this did take me 2 and a half hours. also, x2 for draft content

júnior Guarda
Throat Goat
Reply
#2

Most of the code in this had a few errors, I can update it if people are interested.

júnior Guarda
Throat Goat
Reply
#3

wait i went 85th in my own media lmao

júnior Guarda
Throat Goat
Reply
#4

epic

[Image: arTbD7O.png]

Germany Berserkers Stampede Stars Barracuda syndicate
Reply
#5

Haha nice :D
Reply
#6

This should be full credit for my boy.

[Image: 1rdovVs.gif]

[Image: X6NDpNM.png][Image: 6eXcLdf.png]
Reply
#7
(This post was last modified: 05-18-2020, 09:34 AM by AgentSmith630.)

Quote:72. Rikard Bjerg (Right Defense) @AgentSmith630

Rikard ,a top prospect in his class, is a winning right defense


Other than the rank, I see nothing wrong with this lol

[Image: AgentSmith630.gif]
Thanks to @sulovilen, @the5urreal, and @sve7en for the sigs!
Reply
#8

05-18-2020, 09:34 AMAgentSmith630 Wrote:
Quote:72. Rikard Bjerg (Right Defense) @AgentSmith630

Rikard ,a top prospect in his class, is a winning right defense


Other than the rank, I see nothing wrong with this lol
we did it algorithm fixed

júnior Guarda
Throat Goat
Reply
#9

05-18-2020, 02:14 PMLoco Wrote:
05-18-2020, 09:34 AMAgentSmith630 Wrote: Other than the rank, I see nothing wrong with this lol
we did it algorithm fixed
Cheers

[Image: AgentSmith630.gif]
Thanks to @sulovilen, @the5urreal, and @sve7en for the sigs!
Reply
#10

young logo

[Image: bluesfan55.gif]
Armada Steelhawks Switzerland

Armada Specters Wolfpack Steelhawks Forge Switzerland

Scarecrows pride Chiefs Riot Stars Blizzard Ireland

ty to @High Stick King @EvilAllBran and @Ragnar for the sigs
Reply




Users browsing this thread:
1 Guest(s)




Navigation

 

Extra Menu

 

About us

The Simulation Hockey League is a free online forums based sim league where you create your own fantasy hockey player. Join today and create your player, become a GM, get drafted, sign contracts, make trades and compete against hundreds of players from around the world.