Programming Pokemon Showdown! Auction Bot

Nineage

Pugnacious.
is a Programmeris a Community Contributoris a Tiering Contributoris a Top Contributoris a Site Content Manager Alumnusis a Forum Moderator Alumnus
https://gist.github.com/Nineage/2796ee3a644174e27ce7ec9380e70ea0

Hello everyone!

So for a while now premier league drafts have been done on IRC, but with the ever-growing popularity of PS!, I recently got the request to make a draft bot to be used in Pokemon Showdown. On finishing, I realized that with a few tweaks, the bot could very easily be made to fit any kind of Premier League auction, and I decided to release it to you all. The code is based on a draft bot made by my friend Sparkychild so lots of credit to her. This bot code was used successfully in the UnderUsed Premier League auction, and will be used in the upcoming Little Cup Premier League.

All of the code you need for this bot can be found here. The bot is by no means 100% complete, but it is totally functional, and I am working to iron out any minor errors that still exist.

Instructions for use:
1) Download Ecuacion's Pokemon Showdown Bot at https://github.com/Ecuacion/Pokemon-Showdown-Node-Bot and follow the instructions for installation and configuration.
2) Put the code above into the commands folder
3) (Optional) Edit the settings at the top of the file to control initial money, needed players, and default teams. If you want to enable players to use .4 to bid (rather than .bid 4), you will need to add a line to command-parser.js as well.
4) Run your bot. Note that to start and control a draft you will either need to be a roomowner, or have added yourself to Config.exceptions.
5) Run .draft init to begin a draft, .draft addteam to add a team, and .draft load* to load players. Then run .draft start. More detailed command help can be found by doing .draft help
6) Enjoy your draft!
7) When done drafting, use .draft end

*When using .draft load (the command that loads the players), you should use a raw pastebin or hastebin link that looks something like this. You can get this from a spreadsheet that looks like this by choosing Save As...csv.

That should be pretty much it! The code is fairly easy to edit, so you should be able to tweak it to your needs. If you really can't figure it out, shoot me a VM on here or a PM on PS and I can help. I might also be able to host the bot for you if you need a host.
I apologize in advance for a few places where my code is really suboptimal.
 
Last edited:

Nineage

Pugnacious.
is a Programmeris a Community Contributoris a Tiering Contributoris a Top Contributoris a Site Content Manager Alumnusis a Forum Moderator Alumnus
Updated code!
The errors with maximum bid amount, withdraw, and override have been fixed! The error where a team could bid the same amount as a previous team has been fixed as well. Also, the nomination message now appears at the end of the list of teams, not the beginning (exception: because of the way the start command works, the very first nomination message appears at the beginning).
Also, due to popular demand, the .draft pause and .draft resume commands have been added. While they don't actually pause the draft, they prevent anyone from making a nomination or bidding until the draft is resumed. This prevents pesky managers nominating players when you are trying to edit money amounts or player lists.
Please, post any more bugs you find with the code in this thread so I know to fix them.
 

Nineage

Pugnacious.
is a Programmeris a Community Contributoris a Tiering Contributoris a Top Contributoris a Site Content Manager Alumnusis a Forum Moderator Alumnus
Important update:
The code has been updated with a whole bunch of code fixes! These include...
  • Bot no longer crashes when the final player withdraws
  • You can now add and remove bidders before the bidding starts
  • Removing players is no longer broken
In addition, I've added both a draft summary feature, which logs all player prices, additions, and removals, and the ability to nominate a player without getting the exact capitalization right (e.g. you can now do .nom star OR .nom Star. and they will do the same thing).
Please note that the bot does NOT log the draft for you (I've gotten questions about this). If you want to log the draft, its a pretty easy thing to add into the bot, or just log it using some other tool.
 

Nineage

Pugnacious.
is a Programmeris a Community Contributoris a Tiering Contributoris a Top Contributoris a Site Content Manager Alumnusis a Forum Moderator Alumnus
With Premier League season approaching again, I've gone back over the code and caught a few dumb errors I made a year ago. If you plan to use this bot, you should update the code to the latest version (still found at the link in the OP). There are a few really bad bugs that I'm surprised never came up last year.

Also, I am available again this year if anybody needs a host for the draftbot. Just shoot me a PM/VM if you are interested. If you find any bugs using it on your own, please let me know here!
 

Users Who Are Viewing This Thread (Users: 1, Guests: 0)

Top