Programming Pokemon Showdown Draft League Draft Management.

:]

Hello everyone, my name is Execute. One day when I was in a skype group chat, One of my friends asked me if I wanted to join a draft league. As he told me the rules, I stared at my screen baffled at the idea. For the longest time, I had the idea drilled into my head that there were 4 ways to play pokemon : Wifi, Shiny Hunting, Smogon Battling, and VGC. The idea of draft leagues was a new and revolutionary idea to me.

One of the things that really ticked me about them, however, was that there was no tools to insist in the drafting process. Everyone was using google spreadsheets to keep track of the draft. Drafts were typically really messy and involved a lot revision and going back to change stuff and etc. Some drafts even took multiple days and sometimes weeks, which made it really confusing to see whose turn it is and what not.
  1. To solve this problem, I took it upon myself to create a file that you can put onto your PS! server's chat-plugins folder, that will manage the whole draft process in a very easy, elegant manner. Draft Leagues and pokemon in general is something that is supposed to be fun and not stress us out. The point of this PS Plugin is to minimize the amount of work for the host and participants need to do, by allowing Javascript to do all the work ^_^
How do I install this file into your PS! Server?
  1. This is quite simple. Click here.
  2. Then you simply click the "Download ZIP" button on the top right corner.
  3. Unzip the ZIP file and open the folder, you should find a file inside the folder named "drafts.js".
  4. Drag this file into your server's Chat-Plugins folder.
  5. This file requires 2 modules that are not apart of main, so you are going to need to install them. To do so, simply :
    1. Go into your terminal and change you directory to your server files, to do so end : CD (Server FILES LOCATION)
    2. type in your terminal : "npm install origindb", press enter afterwards.
    3. type in your terminal : "npm install path", press enter.
  6. Congrats! you are finished!
Now that I have installed the file onto my server, how do I use it?

Any room has access to these commands. Adding a couple of commands that are admin / leader only that will determine what rooms may use this plugin or not is definitely possible, but I didn't feel that need to do so. If people request such a feature to be implemented, I will do so.

To create a draft, simply enter the command /draft create. To add teams to the draft, do /draft addteam, (team name), (manager of said team, a username). The reason I included a team name parameter is because many draft leagues require every manager to have a team name, like "Brooklyn Brelooms". To start the draft, simply type /draft start. /draft end ends the draft. This shouldn't be needed in most cases, as the draft script ends the draft automatically. For reference, here is a list of every command and their purpose :

Adminstrative Commands : Requires #,&,~
/draft create - Creates a draft in the room.
/draft end - Ends a draft.
/draft addteam, (teamname), (manager) - Adds a team to the draft. This allows the user the ability to take part in the draft.
/draft removeteam, (teamname) - Removes a team from the draft. This strips them of their ability to take part of this draft.
/draft max, (max) - Sets the max number of pokemon any team may draft in this draft.
/draft random, (true, false) - Sets the order of the draft to either be random or not.
/draft snake, (true, false) - Sets the order of the draft to snake or not.
/draft reset - Deletes all the data of a draft.
/draft start - Starts the draft.
/draft stats - Displays every team participating in the draft with their respective manager, and every pokemon they have drafted up until that point.
/draft change, (teamname), (draftpick), (desired Pokemon) - Allows the league manager to rewrite draft data. This should be used when a particpant makes a mistake. This shouldn't ever be the case seeing as draft script automatically rejects any spelling errors in a pokemon's name, but this command is here if it is ever needed.
/draft drafted - Displays the pool of pokemon already drafted. These pokemon are not able to be claimed by anyone else after they are drafted.
/draft end - Ends a draft league instantly. Unless you really need to end it, you shouldn't use this command, as the draft automatically ends when every player has finished drafting.

/draftmon (pokemonname) - Allows a draft member to draft a pokemon onto their team.

THIS DOES NOT REPLACE THE PURPOSE OF A SPREADSHEET ENTIRELY, but I do have plans of making a plugin that does just that n_n

IT IS IMPORTANT TO NOT HOTPATCH WHILE A DRAFT IS IN SESSION. - This is because I didn't see the need to save ALL the draft data and taking up un needed space. If you are not the owner the server you host your draft on, I'd recommend making an appointment with the development team to ensure none of your data goes corrupt.

^These commands are also available on the server by doing /draft help.

Incase you missed the link to the code, here it is :

https://gist.github.com/xExecute/ee29841312a92dc6cbcdfc64d5b2a3f9

If you have any questions, concerns, or possible improvement ideas, feel free to comment them below!

I hope you have a nice day.

TO DO LIST :

1. PM users when its their turn.
2.Give someone the ability to draft for someone else.

 
Last edited:

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

Top