Set Self-Buffs

==Summary==
Set Self-Buffs allows a user to modify their stat (STR, INT, CON, PER) buff values to any custom value without affecting the buffs of others in their party. It can be run as often as needed during the day to modify buffs or set them back to a baseline value.
There are two versions of this add-on:
*Set Self-Buffs (Script): This version is a manually-driven script, which means it is run in Google Apps Script rather than through the Habitica user interface.
*Set Self-Buffs (Habitica): This version is an event-driven script, which means it creates reward task buttons in your Habitica user interface.
==Tips==
#This script can be used to increase or decrease your buffs.
#Use the Script version to explore different customizations to meet your specific goals before setting up the Habitica version.
#Add time-driven triggers to the Script version to keep your buffs at a consistent level throughout the day (e.g., to run the script every hour, every minute, etc.)
#To zero out stats gained from buffs as well as leveling and equipment, enter negative values in lines 8-11. This will set a negative buff which will counteract the stat gains from other sources.
==Code==
Set Self-Buffs (Script) Google Script | GitHub | raw code
Set Self-Buffs (Habitica) Google Script | GitHub | raw code
==Set Self-Buffs (Script)==
This version is a manually-driven script, which means it is run in Google Apps Script rather than through the Habitica user interface. This means a simpler set-up process at the beginning and greater control and customization each time you use it.
===Setup Instructions===
Click this link for the code, or follow the simple setup instructions below. This script allows you to set your buffs to custom amounts using the Google Apps Script. Simply follow these steps: 
#Click here to go to the Set Self-Buffs script. 
#*If you're not already logged in to your Google account, you will be asked to sign in.
#In the menu on the left, click on "Overview" (looks like a lowercase letter i inside a circle).
#Click the "Make a copy" button (looks like two pages of paper).
#At the top of your screen, click on "Copy of Set Self-Buffs (Script)." Remove "Copy of" and click "Rename."
#Open your API Settings. Highlight and copy your User ID (it looks something like this: 377a4d3d-c55c-48b8-9bf8-59b97480daf8). In the Set Self-Buffs script, paste your User ID between the quotations on line 7 where it says const User_ID = "[User ID]".)
#*Delete brackets, but leave the quotation marks
#*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 on line 8 where it says const API_Token = "[API Token]".
#*Delete brackets, but leave the quotation marks
#*It should now look something like this: const API_Token = "377a4d3d-c55c-48b8-9bf8-59b97480daf8".
#Change the number values in rows 12-15 to your desired buff amounts. Set to "0" to remove all buffs.
#Click "Save" (looks like a disk).
#Select the function you want to run from the drop-down list to the right of the "Debug" button, near the top of the page. The list will include the following: 
#*set_all_buffs
#*set_strength
#*set_intelligence
#*set_constitution
#*set_perception
#*Note: do not use the api_updateUser function. Not terrible if you do, just not helpful to do so.
# Click "Run" at the top of the screen.
#You may need to grant permission on your Google account to run the script for the first time. If you see a pop-up, click "Review permissions" then select your Google account. Click on "Advanced," then "Go to Set Self-Buffs (Script) (unsafe)" (Don't worry, it is safe!) Then click "Allow."
# Wait for it to say "Execution completed."
# Return to your Habitica app and refresh or sync the page. You can view your profile to confirm your buffs have been properly updated.
==Set Self-Buffs (Habitica)==
This version is an event-driven script, which means it creates reward task buttons in your Habitica user interface. These buttons are fixed with pre-set buff values that can be clicked at any time to reset you to your chosen stat buffs.
===Setup Instructions===
Click this link for the code and follow the instructions in Setting Up Streamlined Scripts, or follow the simple setup instructions below. 
#Click here to go to the Set Self-Buffs (Habitica) script. 
#*If you're not already logged in to your Google account, you will be asked to sign in.
# In the menu on the left, click on "Overview" (looks like a lowercase letter i inside a circle).
#Click the "Make a copy" button (looks like two pages of paper).
#At the top of your screen, click on "Copy of Set Self-Buffs (Habitica)." Remove "Copy of" and click "Rename."
#Open your API Settings. Highlight and copy your User ID (it looks something like this: 377a4d3d-c55c-48b8-9bf8-59b97480daf8. In the Set Self-Buffs script, paste your User ID between the quotations on line 7 where it says const User_ID = "[User ID]".)
#*Delete brackets, but leave the quotation marks
#*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 on line 8 where it says const API_Token = "[API Token]".
#*Delete brackets, but leave the quotation marks
#*It should now look something like this: const API_Token = "377a4d3d-c55c-48b8-9bf8-59b97480daf8".
#Change the number values in rows 12-15 to your desired buff amounts. Set to "0" to remove all buffs.
#Click "Save" (looks like a disk).
#Go to Event-Driven (Webhook) Scripts Setup Guide and follow steps 23–40 of Setting Up Streamlined Scripts.
#Return to your Habitica app and refresh or sync the page. You can view your profile to confirm your buffs have been properly updated.
==Gratitude==
Thanks to all those who laid the groundwork for me to learn to script, and who provided direct or indirect inspiration, troubleshooting, and support for this add-on, specifically @mike_the_monk and @bumbleshoot!
==Contact==
Please message @benniefolyfe for questions or troubleshooting. I'm happy to help!
Category:Extensions, Add-Ons, and Customizations
Category:Streamlined Event-Driven Scripts