Below you will find the Illustrated Installation Guide for the Habitica GAS Template.
You can find the original instructions here.
Installation[]
The following installation instructions are valid for all scripts using the GAS Template.
Getting a script[]
The first step is to get the source code of the script into your personal account:
- Go to the site of the script you want to install on Google Apps Script.
The author will provide you with the corresponding link.
For the raw template the source is here. - If you're not already signed in to your Google Account, you will be asked to sign in.
- In the main menu on the left, click on "Overview" (looks like an i in a circle).

Overview menu 
Make a copy - On the upper right side, click on "Make a copy" (looks like two sheets of paper).
- At the top of the following screen, click on the name of your script and remove "Copy of ..." in the dialog, that pops up. Confirm by pressing "Rename".

Rename your script 
Renaming dialog - The order of files is somewhat important, but it is sometimes scrambled after copying the script. For the correct order, use the "Sort files alphabetically" button above the file list (has AZ written on it with an arrow above / below it).

Sort the files
Configuring a script[]
Congratulations, you made is this far. Next we configure your script:
- Open the file setup.gs on the left of your script.

Open setup.gs - Go to the Site Data in your Habitica settings.

Habitica Settings 
Habitica Site Data - Copy your User ID and replace
PasteYourUserIdHerein setup.gs with your User ID. It should now look something like this:const USER_ID = "12345678-90ab-cdef-1234-567890abcdef";.
PasteYourUserIdHere - Back on Site Data in your Habitica settings, reveal your API Token by clicking "Learn more" behind it.

API Token "Learn more" 
Habitica API Token - Copy your personal API Token and replace
PasteYourApiTokenHerein setup.gs with your API Token. It should now look something like this:const API_TOKEN = "12345678-90ab-cdef-1234-567890abcdef";.
PasteYourUserIdHere - Look at all the other customizations and options provided by the script author in setup.gs. Feel free to change them according to your needs. But take care, that you only edit in between
=and;and make sure to keep all quotations". - In the toolbar on the top, click "Save project" (looks like a floppy disk) or simply hit
Strg+S.
Save project
Deploying a script[]
Your script now has all the necessary code and options to fulfill your wishes. Now to the final step, deploying it:
- In the upper right corner, click the blue "Deploy" button and select "New deployment".

Deploy button 
New deployment - Make sure, the type "Web App" is selected via the "Select type" (looks like a gear).

Select "Web App" as type - Check that "Execute as" is set to "Me" and "Anyone" is selected in "Who has access", then hit the "Deploy" button.

Configuration of the Web App - Next you will be asked to authorize access to your data for the Web App. Click "Authorize access" and follow the on-screen instructions.

Authorize access for the Web App - In the following screen, click the URL listed under "Web app". You should see your script interface.

Open your Web App - Finally click on "Install" and wait for the action to finish.
If your script status shows as INSTALLED, you made it and your script is active!
Resolving errors in the configuration[]
You made it to the last step, but your script doesn't switch to INSTALLED?
Than maybe there was as mistake while editing the configuration, let's see:
- Go back to your script code in Google Apps Script (the tab should still be open next to your script interface).
- In the main menu on the left, click on "Executions" (looks like three lines with a play button).
- Search for a line with function name "install" and click it. It should be within the first five lines.
- You are now provided with the event log of your most recent installation attempt. Check for any errors or warnings and resolve them.
- After resolving, follow the steps in Updating options, but click "Install" in the last step.
Assuming you resolved all mistakes, your script status should now be INSTALLED.
If not, repeat this step or ask for help as stated in in the next section.
Unsolved errors, questions, or advice[]
You can't finish your script installation, have questions regarding the behavior of the script or want some simple advice? Then there are multiple options:
- If the script has a corresponding GitHub page, you can open an Issue or a Discussion on your topic.
- Contact the Aspiring Comrades on the official Discord channel of Habitica.
- Write an in game message to the author.















