This is modified code from Aeiiry's googleSheetsPokemonUtilities. I've been using a custom version of it for a while and decided to update it because it may be of use for someone else (I also wanted to gain some practice with GitHub). After reading about GitHub I've come to the conclusion that this is not a fork because it's not meant to substitute or improve the original code, it's more like a parallel version for different needs.
The main difference of my version is that I tried to simplify it and add some options focusing on my actual needs for trade sheets. You should probably check both anyways.
What Aeiiry's version has:
- Button to insert Pokémon sprites (cell to the right)
- Button to insert Pokémon types (cell to the right)
- Button to insert Pokémon weakness/resists (2 cells to the right)
What my version has:
- Button to insert Pokémon sprites (cell to the right) and Pokémon number (cell to the left)
- Button to insert shiny Pokémon sprites (cell to the right) and Pokémon number (cell to the left)
His version also inserts a new column to the right if there's no space. This gave me problems in some situations so my version will override whatever is on the left or right cells.
It helps Google Sheets communicate with PokéAPI to (semi)automatically get Pokémon information (in this case, sprites, shiny sprites and national dex number).
Other sheets will have a database in a separate sheet, where you have a Pokédex with Pokémon data that is later called in the sheets you use via VLOOKUP. This would need to be updated manually when new Pokémon are added in new games of the franchise.
Since this script connects to an external database (PokéAPI), this is unnecessary: you just to type the Pokémon's name and click the corresponding button to get the sprite.
Probably the best thing is that it doesn't ask you to change your spreadsheet. It can be added to the one you're already using (unless you don't like the style of the sprites...).
Write Pokémon names in cells, select those cells and then click the button of your choice to get the sprites and National Pokédex number.
In my version, the setup for the spreadsheet is something like: empty cell (the script will write the pokédex number here) + cell where you manually write the name of the desired Pokémon + empty cell (the script will write the sprite of your Pokémon here)
Names need to be written with hyphens instead of spaces. Ex: Sandy-Shocks, Deoxys-attack, Wormadam-sandy, etc.
If you can't seem to get it to recognize a pokemon, head to PokéAPI and enter "pokemon-species/" followed by the name of the pokemon's species (e.g wormadam), then check under "varieties" for a list of pokemon names the api will recognise.
Also, make sure that you don't have spaces in your cell. "Moltres" works fine but "Moltres " will get you an error.
The best spreadsheet is always the one you're already using. Ideally, you'll update the code to your spreadsheet, but here's an example one:
https://docs.google.com/spreadsheets/d/1XwCGti5xF3WwVe53k0ohcrAUsPR5zwVf7g6VwM49PEE/
This installation guide is the original one by Aeiiry.
- If you haven't already, make a new google sheet here
- In the toolbar in your sheet, click "Extensions" and then click "Apps Script" - This will open a new window
- Copy the contents of the code.gs file to code.gs within the apps script page, making sure to copy it below any existing text
- Press control+S or click the save icon, go back to your google sheet
- Wait for a little bit and refresh the page, a button should show up near the top of the page labelled "Pokemon". If it doesn't show up either refresh again and/or wait for ~20 seconds
- Next we need to grant the script access to your google sheet. Click "Pokemon" in the toolbar and then click any of the buttons that pop up
- A window will pop up reading "Authorization Required", click "Continue". A new window will pop up
- Select your google account, click "Advanced", click "Go to [your project name] (unsafe)", then click "Allow"
- Now the scripts will work!