1. Welcome to Smogon! Check out the Smogon Starters Hangout for everything you need to know about starting out in the community. Don't forget to introduce yourself in the Introduction and Hangout Thread, too!
  2. Welcome to Smogon Forums! Please take a minute to read the rules.

SPL Auction Bot script info

Discussion in 'Smogon Premier League' started by Earthworm, Dec 27, 2011.

Thread Status:
Not open for further replies.
  1. Earthworm

    Earthworm
    is a Tournament Director Alumnusis a Super Moderator Alumnusis a Tiering Contributor Alumnusis a Smogon Media Contributor Alumnusis a Past SPL + WCoP Winneris the Smogon Tour Season 6 Champion

    Joined:
    Nov 3, 2007
    Messages:
    2,648
    For those who don't already know, I wrote a script for this year's SPL auction draft. How the auction bot works:

    Bidders: LonelyNess will first add the managers and assistant managers to the bidder list for their respective teams. Only the nicknames added to the bidder list for each team can nominate or bid on players. LonelyNess can add or remove bidders at any time before or during the auction. Syntax: !addbidder TEAM_ABBRV IRC_NICK and !removebidder TEAM_ABBRV IRC_NICK

    Retainers: LonelyNess will announce each team's retainers and then manually add them to the teams using the !addretainer command. In the log they will look like normal auction sales. Syntax: !addretainer TEAM_ABBRV RETAIN_COST USERNAME

    The Auction: When everyone is ready and the bidders and retainers are done, LonelyNess will type !start. The first team will be up to nominate a player using !nominate USERNAME. Once they have done this, the bot will acknowledge the nomination and message the channel with the metagames played by the user. All bids start at 3000 credits. Only multiples of 500 are accepted by the bot. Any of the following are acceptable bids:

    !4 will bid 4000 credits.
    !4.5 will bid 4500 credits.
    !5k will bid 5000 credits.
    !5000 will bid 5000 credits.

    When a player is nominated, the bot will start a 20 second timer. The length of this timer can be adjusted by LonelyNess by him typing !settimer SECONDS. No bids made during these first 20 seconds have any influence on the amount of time remaining.

    Once the 20 seconds is up, the bot will start a new timer which lasts 10 seconds. After these 10 seconds have passed, the player will be sold. After 5 seconds have passed during this 10 second timer, the bot will message the channel saying "5 seconds remaining." Any bids made during the 10 seconds will mean the timer is stopped, and a new 10 second timer starts, identical to the original. This gives the managers time to react to late bids.

    Since it is somewhat likely that someone will make a ridiculous typo (e.g. !56 instead of !5), LonelyNess has access to a command which will remove the team with the highest bid's bid once during a round. This command is !undobid and only LN can use it.

    After a player is sold, the next team will be up to nominate a player. The process will continue until all teams have either withdrawn from the auction or run out of credits. Teams can only withdraw from the auction when they have at least thirteen players and it is their turn to nominate. Once withdrawn, the team can no longer bid on any players and will be unable to nominate anyone. To withdraw, you must be a bidder on the team. The command to withdraw is !withdraw.

    The order of the draft is based on the standings from SPL 2, and will proceed in a snaking fashion, i.e.: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 1, 2...

    Teams with under 3000 credits and withdrawn teams are automatically skipped by the bot.

    The bot will automatically enforce maximum bids, e.g. if you only have 5 players and you only have 25k left, your maximum bid is 4k, because you need the other 21k to pay the minimum of 3k credits for the other 7 players.

    If for some reason there is an unforeseen problem, LonelyNess can use !pause and !resume to stop the auction at any stage. If this is during bidding, the original 20 second timer will start again to make sure there is time for people to bid once the auction is resumed.

    At any time before, during, or after the auction, anyone with the ability to speak in the channel can use !showteam TEAM_ABBRV to view a team's credits, bidders, and purchased players. LonelyNess can use the command !showall to show all the teams at once.

    Miscellaneous commands that can be used by LonelyNess:
    !next skips to the next team but should not be used under any circumstances since it would allow a team to forfeit a nomination, something that is not allowed.
    !addcredits TEAM_ABBRV CREDITS adds credits to a team. This is useful for the trades that have been going on. CREDITS can be a negative value if removing credits is desired.
    !setcolor COLOUR_CODE can be used to change the colour of the text used by the bot.
    !reset resets everything to the default state.

    TEAM_ABBRV: One of the ten abbreviations for each team.
    • The Stark Sharks = sha
    • The Alpha Ruiners = alp
    • The Indie Scooters = ind
    • The Wifi Wolfpack = wol
    • The Circus Maximus Tigers = cir
    • The Dragonspiral Tyrants = dra
    • The Ever Grande BIGs = big
    • The Team Raiders = rai
    • The Congregation of the Classiest = con
    • The Cryonicles = cry
    IRC_NICK: The exact name a user on synIRC is currently using.
    RETAIN_COST: the exact cost to retain the player being retained. Should be a positive integer with no commas or spaces or "k". e.g. 10000
    USERNAME: The username on the spreadsheet. These should be identical to the forum usernames, except in the case of people with special characters like ¬Chase™ who was causing issues for the script. He is listed as Chase. There is a column in the spreadsheet that documents (hopefully) all differences between forum usernames and the ones used in the spreadsheet.
    SECONDS: A positive integer. Should be between 0 and 20.
    CREDITS: An integer, can be positive or negative (to take away credits). No commas or spaces or "k" or anything like that.
    COLOUR_CODE: anything from 0 to 15. 0 is white, 1 is black, then it continues to dark blue, green, red, dark red, purple, orange, yellow, light green, teal, cyan, blue, pink, dark grey, and light grey. You can press ctrl+k in mIRC to bring up the list.

    That should be everything, let me know if there are any issues. LonelyNess will probably be hosting the bot, and the auction will happen in #spl.

    edit: Here's an example of a nomination + bidding round since that will probably speak better than a bunch of paragraphs:

    The actual text is a lot more colourful than this so it's very easy to see what's happening.
  2. Jackal

    Jackal I'm not retarded I'm Canadian it's different
    is a Tournament Director Alumnusis a Site Staff Alumnusis a Super Moderator Alumnusis a Contributor Alumnusis a Battle Server Moderator Alumnus

    Joined:
    Dec 20, 2004
    Messages:
    6,152
    i LOVE worms
  3. Delta 2777

    Delta 2777 Machampion
    is a Tiering Contributor Alumnusis a Contributor Alumnusis the Smogon Tour Season 10 Champion

    Joined:
    Jun 5, 2009
    Messages:
    1,241
    Programmer badge? Maybe one day
  4. LonelyNess

    LonelyNess PK FLASH
    is a Tournament Director Alumnusis a Forum Moderator Alumnusis a Tiering Contributor Alumnusis a Smogon Media Contributor Alumnusis a Battle Server Moderator Alumnus

    Joined:
    Mar 23, 2007
    Messages:
    3,454
    I want to extend a HUGE thanks to Earthworm for the creation of this bot, as it made the Live Auction run extremely smoothly. I could have done it by hand again but it was so easy to be able to use this instead. Everyone should give him a pat on the back the next time you see him.

    For those that missed out on watching the Auction, here's the log in its entirety.

    Part 1: http://pastebin.com/vUDjcdGN
    Part 2: http://pastebin.com/JiiNaZNs

    Also here is just the results of the auction, in order of player drafted.

    http://pastebin.com/QK5mejD0
Thread Status:
Not open for further replies.

Users Viewing Thread (Users: 0, Guests: 0)