This simple API script allows you and your players to use a macro to adjust the value of the three bars of a token. The script has been updated to use a more aesthetically pleasing emote and eventually support triggering the FX and Aura changes from the Aura/Tint HealthColor written by DXWarlock. I have provided several macros below to highlight possible uses for this script and a list of the variables the GM can set within the script itself (some day I'll get a fancy chat menu and one click install). To Do List: Add chat menu for adjusting variables. Upgrade to a one-click install configuration. Figure out why FX animations aren't being triggered when changes to the token are sent to HealthColor. Make minor adjustments to left margin to center announcement properly. Add option to show red/green chat announcement per use instead of all the time off or on. Add option to color chat announcement using the Player Color instead of any other colors. Break out chat announcement css into a list of options DM can set, including background image. Add results of random rolls in the tooltip when mousing over the result in chat. Add logic to hide npc names if players would not normally be able to see them. March 21st, 2017 ~ 8:45 am eastern Version: 2.0.5 Link: <a href="https://gist.github.com/Sky-Captain-13/a503c359146" rel="nofollow">https://gist.github.com/Sky-Captain-13/a503c359146</a>... Bugfix: Added fix by TheAaron to catch token objects that might not be tokens. March 21st, 2017 ~ 8:45 am eastern Version: 2.0.4 Bugfix: Added logic to exit the script if there is no valid --target tag. Minor Update: Altered the hide function to the following --show|all will announce the results in chat --show|GM will whisper the results only to the GM --show|none will not show any message at all March 8th, 2017 ~ 6:45 pm eastern Version: 2.0.3 Bugfix: Corrected logic for verifying a valid Bar was designated by number or barkey. March 8th, 2017 ~ 6:20 am eastern Version: 2.0.2 Bugfix: Added a -7px left margin to the announcement CSS to properly center the box and text in the chat window. March 8th, 2017 ~ 2:25 am eastern Version: 2.0.1 Bugfix: FX Animations are now properly triggered by the Aura/Tint HealthColor script by DXWarlock. March 8th, 2017 ~ 12:00 am eastern Version: 2.0.0 Initial Release: Please report any bugs you come across. Thanks! Variable Descriptions ALT_COLORS If set to true, AlterBars uses a dark green or dark red emote instead of the default orange color. PREVENT_OVERMAX If set to true, AlterBars will reset the bar's value to its maximum if it would be over that max value. STOP_AT_ZERO The opposite of prevent_overmax, this option will set a bar's value to zero if it would drop below that. ANNOUNCE_CHANGE Set to true to send a message to the chat window, showing which token gained or lost points and how much. ALTER_GM Change to true to send an alert to the GM instead of everyone. Bar Names & Designations A small upgrade to this script is the ability to provide the verb and singular and plural names of the bars. Formerly, the script simply used gained or loses, but now you can set these options per bar and whether it is a gain or a loss. The default settings assume Bar1 is being used for Hit Points (which is the default bar used for HP on tokens made for the built-in compendium for D&D 5e). Example: Paladin heals 5 hit points. var Bar1Gain = ["heals", "hit point", "hit points"];
var Bar1Loss = ["takes", "damage", "damage"];
var Bar2Gain = ["recovers", "mana", "mana"]
var Bar2Loss = ["spends", "mana", "mana"]
var Bar3Gain = ["heals", "hit point", "hit points"];
var Bar3Loss = ["takes", "damage", "damage"]; Sample Macros Drink a Potion of Healing !alter --target|@{selected|token_id} --bar|1 --amount|+2d4+2 Cast Cure Wounds on Ally !alter --target|@{target|token_id} --bar|1 --amount|+?{Cast at Level|1|2|3|4|5|6|7|8|9}d8 + @{CharacterName|wisdom_mod} Deal Damage to Enemy !alter --target|@{target|token_id} --bar|1 --amount|-?{Damage Dealt|0} Damage (Self) !alter --target|@{selected|token_id} --bar|1 --amount|-?{Damage Taken|0} Heal (Selected) !alter --target|@{selected|token_id} --bar|1 --amount|+?{Amount Healed|0} Heal (Target) !alter --target|@{target|token_id} --bar|1 --amount|+?{Amount Healed|0} Damage (Selected) !alter --target|@{selected|token_id} --bar|1 --amount|-?{Damage Taken|0} Damage (Target) !alter --target|@{target|token_id} --bar|1 --amount|-?{Damage Taken|0}