Google Apps Script

The scripts previously included in this Wiki article have been moved to individual wiki pages for each script. You can search for them by name or functionality on the Extensions, Add-Ons, and Customizations page, or using the search tool.
== Description ==
Google Apps Script is a scripting language based on JavaScript that lets you manipulate Habitica and other Google Suite products like Calendar, Docs, Sheets, Slides, and Forms. There's nothing to install — you use the code editor right in your browser, and your scripts run on Google's servers. All scripts can be scheduled to give a level of automation.
The scripts created for Habitica are Extensions, Add-Ons, and Customizations that allow users to modify and customize their experience.
== Usage ==
In order to use this feature, you need to have a Gmail account. To link functionality back to your specific Habitica user account, these scripts will need your Habitica User ID and API Token input into the code. It is thus recommended that you keep all scripts private.
Google Apps Scripts can be run in three ways:
* Manually — Run by the Habitica user through Google Apps Script rather than through Habitica's user interface. This requires a user to open the script, select the function, and click "Run" in Google Apps Script.
* Time-driven — Use triggers to automatically run at a scheduled time or in set intervals (e.g. every n minutes, hours, or days). Triggers must be set up in each individual Google Apps Script. This can be done either manually or using a function embedded into the script itself, such as an Install or doOneTimeSetup function.
**When setting up a script for the first time, it may be best to run the script manually before scheduling it. You can do this by choosing the function and clicking Run to check that it runs without errors.
**When scheduling the scripts, do not schedule them to run more than hourly. Be nice to Habitica servers!
* Event-driven - Triggered by an event in Habitica (cron, completing a quest, clicking a task, etc.). This method requires more effort to install but becomes much more integrated into the app experience.
== Troubleshooting ==
If you have any questions or concerns regarding unexpected behavior encountered while setting up or using scripts, please go to the scripts troubleshooting page.
== See also ==
* Webhook processing with Google Apps Script
* Streamlined Event-Driven (Webhook) Script Template
* Event-Driven (Webhook) Scripts Setup Guide
* Habitica GAS Template
ru:Google Apps Script
zh:Google Apps Script
Category:Extensions, Add-Ons, and Customizations