Habitica Wiki
Habitica Wiki


Screenshot

Profile Dailies Progress Bar

Description

A Google Apps Script which adds a progress bar in your Habitica profile's "About" section showing the percentage completion of your due Dailies, as shown in the screenshot. The progress bar updates live with your Dailies. Checklists have no effect. You may need to sync in Habitica for changes to show. The bar resets (reloads) each day at a reset time that you can set in the script.

It may motivate its users to be done with their Dailies at the start of the day so that they've filled progress bar for the rest of the day.

Usage

  1. Create a new project in script.google.com
  2. Replace the sample code with this code.
  3. Insert your User ID and API Token in the appropriate places at the start of the code, inside the double quote marks.
  4. Don't enter a value for WEB_APP_URL yet.
  5. You can change the RESET_TIME if you want to.
  6. Choose a title for the project. It can be anything, e.g., "Habitica: Profile Dailies Progress Bar".
  7. Deploy the code as a web app, using these settings:
    • "Description": you can ignore this, or enter any text that you want
    • "Execute as": choose "Me"
    • "Who has access": choose the option called "Anyone" or "Anyone, even anonymous", depending on whether you are using the new or old design of Google Apps Script. Do not choose "Anyone with a Google account".
  8. Click the "Deploy" button and wait a while.
  9. Click the "Authorize access" button.
  10. Select your Google account.
  11. You will see a warning that "Google hasn’t verified this app". This is expected since you have just created the app yourself. Click "Advanced", then click the link labelled "Go to ...".
  12. Click the "Allow" button.
  13. You will see a screen containing a Deployment ID and the web app's URL. Copy the URL to your clipboard then click "Done".
  14. Paste the URL into the script inside the double quote marks where it says WEB_APP_URL.
  15. Run the function "setup". If you are using the new design of Google Apps Scripts, it will show you "Execution completed".

The "setup" function will create:

  • a progress bar on your profile, showing the current status of your Dailies
  • a webhook in your Habitica account, to allow live updates of the progress bar (to check the webhook, visit the user Icon > Settings > API page in Habitica; it should show the web app URL)
  • a daily trigger in Google Apps for resetting the progress bar (to check the trigger, visit the script.google.com/home/triggers)
Thanks To
Habitica users @shiv-s and @bumbleshoot from the Aspiring Comrades Guild.