Reschedule Tasks

Note: This script is functional, but is still in development. Click here for a list of upcoming features.
=Summary=
This script allows a user to automatically reschedule their tasks (dailies and to-do's) a set number of days after the task is completed. 
Note: The to-do's functionality is still in development.
=Description=
=Things to Know=
=Code=
The code can be found at: Google Apps Script
=Setup Instructions=
Click this link for the code and follow the instructions in Setting Up Streamlined Scripts, or follow the step-by-step setup instructions below. 
==Create the script==
#Click here to go to the Reschedule Tasks script.
#* If you're not already logged in to your Google account, you'll be asked to sign in.
# Go to the "Overview," the top tab on the left side (a circle with an “i” inside)
# Click the "Copy" icon on the far right (two papers)
# Rename your new script, removing “Copy of”
# Save the script (disk icon)
==Personalize the script==
# Open your API Settings. Highlight and copy your User ID (it looks something like this: 377a4d3d-c55c-48b8-9bf8-59b97480daf8. In the Reschedule Tasks script, paste your User ID between the quotations where it says const User_ID = "[User ID]".
#* It should now look something like this: const User_ID = "377a4d3d-c55c-48b8-9bf8-59b97480daf8".
# On the same page where you copied your User ID, click the "Show API Token" button, and copy your API Token. In the Google script, paste your API Token between the quotations where it says const API_Token = "[API Token]".
#* It should now look something like this: const API_Token = "377a4d3d-c55c-48b8-9bf8-59b97480daf8".
# Input the amount you'd like to heal the boss or injure your party each time you run the script or click the button
# Input your current stats gained from armor and level (do not include your buffs)
# Change the binary values to select which buttons you'd like to install (1 to install, 0 to ignore)
# Save the script (disk icon)
==Deploy the script==
This step creates a snapshot of the current settings and saves it as a deployment. It also creates a URL that allows you to access the deployment, which you’ll use in the next step, “Create a webhook.”
# Click the “Deploy” button (blue button in the top right)
# Click “New deployment”
# Click on the “Settings” icon (gear)
# Click on “Web app”
# Under "New description" type something brief that will help you identify this specific deployment of the script (e.g., “first” or “final”)
# Under “Execute as:” make sure it says “Me”
# Under “Who has access” make sure it says “Anyone”
# Click “Deploy”
==Create the webhook==
A webhook connects Habitica with a specific deployment of your script, allowing Habitica to function in sync with the script. For example, it can allow a Habitica event like a quest starting, or clicking a specific task) to trigger an outcome in the script.
# Click the “Deploy” button (blue button in the top right)
# Click “Manage Deployments”
# Select the deployment you want to sync your webhook with
# Click “Copy” under the Web App URL
# Click “Cancel”
# Add the URL to the appropriate line in the Google Apps Script, surrounded by quotation marks
==Run the doOneTimeSetup function==
# Ensure that the doOneTimeSetup function is listed in the drop-down menu to the right of “debug”
# Click “run,” to the left of “debug”
#* You should see "Execution completed" in the Execution Log.
# Return to your Habitica app and refresh or sync the page. You should have your chosen buttons on the reward tab.
=Using the Script=
=Gratitude=
The original author of this script, who has chosen to remain anonymous.
=Contact=
Please message @benniefolyfe for questions, suggestions, or troubleshooting. I'm happy to help!
=Upcoming Features=
I'm still working on the following:
* Reschedule to-do's upon completion
Category:Extensions, Add-Ons, and Customizations