Habitica Wiki
Habitica Wiki



Editable Fix Character Values Buttons[]

by @mike_the_monk

Summary[]

This script expands upon the previous three, allowing you to edit the custom reward buttons once created so you can change what each of them does. Any sort of customization for Habitica should be to help you stay motivated to do your real-life tasks, and what's motivating for you might change as time goes on.

An example use of this script is creating a Super Health Potion that costs 50 GP and heals up to 40 HP. You can edit the notes section of one of the buttons to read GP: -50; HP: +40; and then every time you click the button, it does exactly that. But maybe later on, you have much more gold and are a higher level, and want to make it more expensive. Click the button then edit the notes section to now read GP: -75; HP: +40; so it now costs 75 GP to heal 40 HP. Maybe even later you want to change it so it costs 30% of your GP (whatever it is), so you can edit the notes section to read GP: -30%; HP: +40;.

That gives you some idea of the many things you can do with these editable Fix Character Values buttons. You can create up to five buttons and name them whatever you want, and edit the notes section to change what they do. You are able to affect HP, XP, MP, and GP, you can add to or subtract from those values, and it can be a number or a percent.

Happy customizing!


Note:[]

Please wait 30 seconds between clicking any of the buttons in this script or other scripts. We don’t want to overload the Habitica servers, which can affect everyone, even if they’re not using any of the scripts. If you accidentally click it faster, no worries, I’ve built the code such that if you don’t wait 30 seconds, no code will be executed. So, if you click the button and it seemed like nothing happened, that could possibly be the reason why.


Correct formatting[]

The notes section must be formatted in a certain way in order to work correctly, otherwise you will get an error message (as a private message) from the script. Review the section below to make sure it's formatted correctly. If you're still stuck after reading the section below, please contact the author of this script and he will be glad to help you out.

Here is the proper format:

  • Start with the value you want to change, immediately followed by a colon (no space in between). So, the options are HP: and XP: and MP: and GP: and these must be capitalized. If they are not capitalized, the script will not recognize them and will do nothing with that stat value, so if you are expecting one of those four values to change but it does not change when you click the button, one thing to check is capitalization. This one will not result in an error message, you will have to check it manually.
  • Next, if you want to increase that value, put a +. If you want to decrease that value, put a -. It doesn't matter if you put spaces before or after these, the script will know what you are talking about. Not including a + or a - will result in an error.
  • Next, put the number you want to increase or decrease that value by. If you want to increase or decrease by a percent, include a % right after the number. if you enter something other than a number here, you will get an error.
    • If you are decreasing by non-percent, this is treated as if those stats are a cost that needs to be paid, much like an MP cost for skill or a GP cost for a potion. If you don't have enough of the relevant stat, the code won't run and you will get an error message. For example, if your button reads HP: -25; XP: +1000; GP: -300; , you are treating this button as if there is an HP and a GP cost, and once you pay those, you gain XP. But, if you only have 24 HP and 250 GP, both of which are insufficient, you'll get a message that tells you you have insufficient HP and GP, and you won't gain any XP.
    • If you are decreasing by a percent and accidentally enter a percentage beyond 100 (for example, XP: -105%;), the code will run as if you did -100% and thus bring it down to zero. Conceptually, when decreasing by 100%, you're telling the script "get rid of all of my GP (or HP, or XP, or MP)", which is different than decreasing by a non-percent.
    • If you are increasing by a percent, it will increase based on the current value rather than the maximum value. For example, HP: +100%; will double your current HP, not fill you to full. If you want to fill HP to full, do HP: +50; , that will fill you to full matter what your current HP is, and the script won't let you go above 50 HP.
  • Finally, end with a ;. If you don't include a semicolon, the script won't know where this section ends and will give you an error.
  • You can include all four values to change (HP, XP, MP, and GP) or as few as you want, making sure to start each with the value followed by a colon (for example HP:) and ending with a ;. The order in which you include them does not matter, the script will be able to read it. If there is a value that you don't want to use (for example, you don't want to affect GP), you can delete it section entirely or you can leave it as +0.

For example, if you want a "wipeout" button that removes all of your XP and GP, and removes half of your HP and MP, you could write it as XP: -100%; GP: -100%; HP: -50%; MP: -50%;. If at a later time you decided you wanted the button to do something different, simply edit the notes section of the button.

Another example is a combined Mana and Experience potion that costs 50 GP while giving you 30 MP and 150 XP. You could write that as GP: -50; MP: +30; XP: +150;

Hopefully these examples and the bullet points above show you how to format the notes section of the custom buttons. If you are able to click the button and it does everything you think it's supposed to do (and you don't get an error message), then it's working. Otherwise, revisit this section and revise it until it works, and if you're stuck, you can always contact the author of this script.


First-Time Setup Instructions[]

Code[]

Required Customizations[]

NUMBER_OF_BUTTONS tells the script how many editable buttons to create. You can make up to 5 buttons. The default is 2.

Optional Customizations[]

You can name these buttons if you want, or keep the generic names "Editable Button 1", "Editable Button 2", etc.

  • BUTTON_1_TEXT is the title of Button 1
  • BUTTON_2_TEXT is the title of Button 2
  • BUTTON_3_TEXT is the title of Button 3
  • BUTTON_4_TEXT is the title of Button 4
  • BUTTON_5_TEXT is the title of Button 5

Troubleshooting[]

If you're experiencing issues with the script, please go through the steps listed on this page: Scripts Troubleshooting. Section 3 (Event-Driven (Webhook) Scripts) is especially useful.

If you're not able to resolve the issue, you can contact the author of the script at any of the following places:



Update Instructions[]


Credits and Acknowledgments[]


Scripts by the same author[]

Below are scripts that let you customize Habitica. If you plan on using more than one of them, I recommend installing the superscript, which combines all of my scripts into one.

Automated FCV scripts – these do things you can manually do using Fixed Character Values, all at the click of a button

  • Experience Potion and Mana Potion - pay 25 GP for 150 XP or 30 MP.
  • Anti-Potions - a crowd of onlookers will pay you 25 GP to drink a concoction that somewhat weakens you (-30 MP, -15 HP, or -150 XP).
  • Swap HP or XP for MP - pay 5 HP or 50 XP to gain 10 MP.
  • Editable Fix Character Values Buttons - an expansion on the first three scripts, creating custom reward buttons whose text you can edit to change what the reward does.

Custom skills – at the click of a button, do something it's not possible to manually do using Fix Character Values

Game Modes – these activate a game mode which alters Habitica in a larger, ongoing way for you

  • Bad Day Mode - some days, it's better to rest than to do all of your tasks. Pressing the button fully heals you, buffs your CON to 9999, and Stealths all your Dailies so you take no damage if you miss them.
  • Partial Healing Mode - normally, you fully heal upon leveling up. Players who want an added challenge can instead only partially heal upon level up.
  • Dueling Mode - challenge another player to a duel and the script keeps track of your score. Whoever wins gets the GP that both of you wagered.

Just for Fun – customizations more on the silly side

  • Transform Yourself Year-Round - why wait until the next Grand Gala to turn yourself into a snowman, flower, starfish, or ghost? Creates buttons that transform you for 15 GP (5 GP to turn back), including a never-before-seen Random Transformation item that randomly turns you into one of the four options.