Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
May your rolls be merry + bright! 🎄
Create a free account

Regaining Hit Die in a Long rest Macro

First off I have the following API scripts installed: - 5th Edition OGL by Roll20 Companion - ChatSetAttr - An extra addition to the OGL script that listens for Hit Die rolls: <a href="https://app.roll20.net/forum/post/5581501/slug%7D" rel="nofollow">https://app.roll20.net/forum/post/5581501/slug%7D</a> Now for the fun stuff. (I am VERY new to this whole Macro building and API thing so I'm still getting used to how the syntax works I want to add to my Long Rest Macro something that adds half the max Hit Die total rounded down as per the Long rest rules: At the end of a long rest, a character regains all lost&nbsp; Hit Points . The character also regains spent Hit Dice, up to a number of dice equal to half of the character’s total number of them (minimum of one die). For example, if a character has eight Hit Dice, he or she can regain four spent Hit Dice upon finishing a long rest. My Long Rest Macro looks something like this: !longrest @{selected|character_name} !setattr --silent --sel --class_resource|@{selected|class_resource|max} !setattr --silent --sel --other_resource|@{selected|other_resource|max} &amp;{template:atk} {{desc=**@{selected|character_name}** *Long Rest Taken* Reset HP, Spell Slots, @{selected|class_resource_name}, @{selected|other_resource_name}}} I want to use something like: !setattr --silent --mod --sel --hit_dice|@{selected|hit_dice|max} But I have no idea how to start adding the information needed to give me "Add half the maximum amount of Hit Die rounded Down" Thanks for Reading!&nbsp;
1550813586
Pantoufle
Pro
Sheet Author
Translator
Hello I remember that the !longrest already does the job but I may be wrong :) If not I suppose you could use something like !setattr --silent --mod --sel --hit_dice|[[ceil(@{selected|hit_dice|max}/2)]] (use round or floor instead of ceil if need be)