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 .
×
Create a free account

[Script] Resting in Style

1591629066

Edited 1591638493
Magnar S.
Pro
API Scripter
Taking a quick look at this forum, there seems to be an abundance of resting scripts being released at the same time. Nevertheless, here's my take on it: <a href="https://github.com/magnars/roll20-scripts" rel="nofollow">https://github.com/magnars/roll20-scripts</a> 5E OGL Resting in Style This Roll20 API Script solves the error prone task of updating your character sheet when resting. Using&nbsp; !long-rest &nbsp;and&nbsp; !short-rest &nbsp;commands will update your sheet, and report to you everything it is doing. Short rest Select your character, then run the&nbsp; !short-rest &nbsp;command. It will: check your hit points and hit dice, and remind you to use them if needed. replenish Warlock&nbsp; Pact Magic &nbsp;spell slots. This works correctly even if you are a multiclass spell caster. replenish class specific resources, like&nbsp; Wild Shape ,&nbsp; Second Wind &nbsp;and&nbsp; Channel Divinity . It knows that Bards regain&nbsp; Bardic Inspiration &nbsp;at class level 5. It knows that Sorcerers gain 4 Sorcery Points at class level 20. replenish subclass specific resources, like&nbsp; Superiority Dice &nbsp;and&nbsp; Hexblade's Curse . remind Wizards to use&nbsp; Arcane Recovery , and Bards to use&nbsp; Song of Rest . Long rest Select your character, then run the&nbsp; !long-rest &nbsp;command. It will: replenish your hit points. replenish the correct number of hit dice (even at lvl 1). remove temporary hit points. replenish spell slots. replenish class specific resources, like&nbsp; Lay on Hands ,&nbsp; Arcane Recovery &nbsp;and&nbsp; Rage . replenish subclass specific resources, like&nbsp; Consult the Spirits &nbsp;and&nbsp; Avenging Angel . replenish race specific resources, like&nbsp; Breath Weapon &nbsp;and&nbsp; Relentless Endurance . Usage Resting in Style will generally do the right thing out of the box, as long as you're using the 5th Edition OGL by Roll20 character sheet. However, not all resources are automatically added to the Resource boxes. You might have to add them yourself. For instance, a Wizard starts with the&nbsp; Arcane Recovery &nbsp;skill. This is not tracked in the sheet. Add a custom resource box, set the Total to 1, the value to 1, and the name to "Arcane Recovery". Resting in Style will detect the new resource by name, and start notifying you to use it on short rests, and replenish it on long rests. I have a resource not covered by this script No worries. If your skill is called "Homebrew Resource", you can rename it to "Homebrew Resource [l]" to reset it every long rest. If you instead postfix it with "[s]", then it is reset every short and long rest. Also: Please let me know if I have missed any skills in the official source books, I'll happily add the support.
1591635240
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Nice job, Magnar! I know what you mean about the plethora all appearing at once. It's happened in the past with other types of scripts. I you would like to check for any missing class features, feel free to look at the list in my script . I intentionally left a few sourcebooks out, but that may have been personal preference speaking. I was shooting for AL legal.
1591635880
Magnar S.
Pro
API Scripter
Thanks for tip, Keith. I just found your resting script minutes before releasing this. Bad research on my part not finding it earlier, but I had a lot of fun figuring out the API and getting things to work. Your idea with the [1d6+1] tags to handle recharging wands et.al is very cool.&nbsp; In my mind there are two big issues where the Roll20 character sheet experience is quite a bit worse than that other DnD-site, with resting being one and inventory management the other. Hopefully with these new scripts, we have helped a bit on that first point. :)
1591637218
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Each of the three scripts just released has some feature the others lack I stayed away from the handling of hit dice and other stuff the Companion script handled.&nbsp;&nbsp;It looks like your script does a good job with those. And I really should account for the Bard 5th swap from long to short-long on Inspiration. I have The Aaron to thank for the dice parsing subroutine. That was extremely helpful.
Gah, I was begging for these scripts for months, and then right after I made my own (clumsy) macros, all these fine scripts appear! :) One more I have to check out!
1591638543
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Funny how that happens.
1591655651
Magnar S.
Pro
API Scripter
I added the randomly regained charges feature to the script. I made sure to give a little nod to you in the docs, Keith. Hope that's okay. Let me know!&nbsp; <a href="https://github.com/magnars/roll20-scripts#what-about-items-with-randomly-regained-charges" rel="nofollow">https://github.com/magnars/roll20-scripts#what-about-items-with-randomly-regained-charges</a>
1591656725
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
I'm fine with it. :)
1591656856
Magnar S.
Pro
API Scripter
Good to hear, thanks. You're a class act. :)
Just a short note of thanks for this script. I have used it with no problems on my test game, will install and use with my real games this week.&nbsp;
1591737262
Magnar S.
Pro
API Scripter
Very cool, Michael! Glad to hear that. Do let me know if any issues pop up. :)
Magnar S. said: Taking a quick look at this forum, there seems to be an abundance of resting scripts being released at the same time. Nevertheless, here's my take on it: <a href="https://github.com/magnars/roll20-scripts" rel="nofollow">https://github.com/magnars/roll20-scripts</a> Thanks for all your work on this -- excited to try it out.
1591860514
Magnar S.
Pro
API Scripter
That's great, Chris. Do let me know how it went. :)&nbsp;
1592771267
Magnar S.
Pro
API Scripter
The script has now been updated to also turn off global modifiers for buffs. For instance, it will turn off Bless and Rage &nbsp;after a short rest, and it will turn off Mage Armor &nbsp;after a long rest. I have added quite the list of buffs, but do let me know if I've missed any.
1592862355
Magnar S.
Pro
API Scripter
I have updated the script with lots of missing resources, including support for the tricky Wizard Power Surge , which now correctly resets to 1 on a long rest, and replenishes 0 to 1 on a short rest. :-)
Just added this to my game - works wonderfully! I do have two small questions though. 1) I have a bard who has multiclassed into warlock, as well as a full warlock. The API as is regenerates one of the bard spell slots for the bardlocks on a short rest, because the spell sheet doesn't track the warlock spell slots separately. I can add a class resource and set it up to regen on a short rest, ofc, but how can I prevent a bard spell slot from being regained, without ruining the function for the warlock? 2) On your github, you have a second file for hit dice - how do I use this to make the long rest healing register to other APIs as healing when the hp reset? (currently my health aura stays tinted to wounded when the long rest hp are regained). Thank you so much in advance for your time and effort! I *really* love that this also sends reminders to chat!
1593320806

Edited 1593326670
Magnar S.
Pro
API Scripter
Hi Inkcharm! I'm so glad you found the script useful. :-)&nbsp; 1) I have a bard who has multiclassed into warlock, as well as a full warlock. The API as is regenerates one of the bard spell slots for the bardlocks on a short rest, because the spell sheet doesn't track the warlock spell slots separately. I can add a class resource and set it up to regen on a short rest, ofc, but how can I prevent a bard spell slot from being regained, without ruining the function for the warlock? I might be misunderstanding either your question or the rules here, but my impression is that warlock Pact Magic spell slots are in addition to regular spell slots. For example, a Bard 2 Warlock 1 would have 4 level 1 spell slots (3 from the Bard, 1 from the Warlock), but not the 2-nd level spell slots they would get if they were multiclassed into another full spell caster. However, these spell slots can be used interchangeably. You can use your "warlock spell slot" to cast Bard spells.This is one of the perks of multiclassing into Warlock. Do let me know if I've misunderstood. 2) On your github, you have a second file for hit dice - how do I use this to make the long rest healing register to other APIs as healing when the hp reset? (currently my health aura stays tinted to wounded when the long rest hp are regained). I have noticed this as well. I had hoped that the `setWithWorker` function would notify other scripts about the hitpoint change, but that doesn't seem to be the case. I'll have to investigate further. Thanks for the report! Edit: I am trying to find a solution to this. What script are you using to tint wounded characters? DeathTracker? Thank you so much in advance for your time and effort! I *really* love that this also sends reminders to chat! Thanks for letting me know. It's something when a Bard finally uses Song of Rest, huh? ^^
1593336304
Magnar S.
Pro
API Scripter
If you are indeed using DeathTracker, Inkcharm, you can try out the newest version of the script. For technical reasons, you must also install the TokenMod script if you haven't already. If you do try it out, I'd be happy to know if it works / doesn't work for you, or if you are using some other script than DeathTracker.
Hey!&nbsp; Ignore everything I said about the spell slots, that was a problem with how my player set up the sheet, we have corrected it and now everything is working wonderfully there xD I use Aura/Tint HealthColor for tracking - token mod is installed.
1593361192
Magnar S.
Pro
API Scripter
Glad to hear the warlock spell slots work for you now. :) Unfortunately, the Aura/Tint HealthColor script only listens to built-in change events, that other scripts cannot trigger. There's no standard way of solving this problem at the moment, which is a shame. I was able to add support for scripts that listen to the custom events sent by TokenMod, which includes DeathTracker. It also has the ability to tint damaged characters.
Thank you for checking that!&nbsp; We did find one thing that doesn't seem to be done through tracking: Exhaustion levels. They can be tracked through the OGL sheet, but aren't lowered by the API. Do you have the means to add it / do you plan to? It's not a big thing ofc, just something my players noticed while testing.&nbsp;
1593408969
Magnar S.
Pro
API Scripter
That's one I've plain forgot. Consider it in the pipeline. :-)
Awesome!&nbsp; Big thumbs up from myself and my players. They're all very very very delighted by this API, especially with the reminders sent to chat.&nbsp; At "Consider Song of Rest" our Bard went "Stop calling me out like this!", and everyone was just plain delighted ;)
1593549479
Magnar S.
Pro
API Scripter
I'm happy to say that this script is now available as a one-click install in the script dropdown. :)&nbsp;
I have your script loaded the DIY way and I noticed it was now in drop box so I deleted it and did the drop box one and when I restatred it came up with a error about no script found??
1593698765
Magnar S.
Pro
API Scripter
Giulio M. said: I have your script loaded the DIY way and I noticed it was now in drop box so I deleted it and did the drop box one and when I restatred it came up with a error about no script found?? Yeah, all the most recently added scripts are behaving this way. There's some roll20 bug going on. While we wait for a fix, it's back to the DIY way, unfortunately.
1593700422
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
You can click the "Import" Button, instead of "Install". It will download the script into your campaign as if you had installed it manually (editable text). The script will work fine, but you won't receive any automatic updates. I have two scripts in the same boat.
1593700921
Magnar S.
Pro
API Scripter
I have now updated the script to also reduce exhaustion level by one after a long rest. Thanks for the idea, Inkcharm. :)&nbsp;
Quote...You can click the "Import" Button, instead of "Install". It will download the script into your campaign as if you had installed it manually (editable text). The script will work fine, but you won't receive any automatic updates. I have two scripts in the same boat. "Import" button? or even "Install"&nbsp;&nbsp; is this on the API scripts page of a game as I dont see them.......just curious I am missing something here :P
1593761567
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
You have to "delete" the script. The Import button only appears if the script does not exist in the campaign. The buttons are on the API page. Just choose the script from the dropdown and you should see both options.
Ok thanks I see it now
1593791056
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
One Click is hopefully working now.
1594239269
Magnar S.
Pro
API Scripter
This script now works with the one-click installer - including support for exhaustion levels. Yay! :)&nbsp;
Magnar S. said: This script now works with the one-click installer - including support for exhaustion levels. Yay! :)&nbsp; This is an awesome contribution, Magnar. Has become part of my core API kit.
1594281275
Magnar S.
Pro
API Scripter
Chris said: This is an awesome contribution, Magnar. Has become part of my core API kit. Thanks, Chris. That makes me happy to hear. :)&nbsp;
This is an awesome contribution, Magnar. Has become part of my core API kit. Me to....very useful
Magnar S. said: Also: Please let me know if I have missed any skills in the official source books, I'll happily add the support. I believe the Celestial Warlock's " Healing Light " ability is missing (Xanathar's Guide). Healing &nbsp; Light At&nbsp; 1st Level , you gain the ability to channel&nbsp; Celestial &nbsp;energy to heal wounds. You have a pool of d6s that you spend to fuel this&nbsp; Healing . The number of dice in the pool equals 1 + your&nbsp; Warlock &nbsp;level. As a&nbsp; Bonus Action , you can heal one creature you can see within 60 feet of you, spending dice from the pool. The maximum number of dice you can spend at once equals your&nbsp; Charisma &nbsp;modifier (minimum of one die). Roll the dice you spend, add them together, and restore a number of&nbsp; Hit Points &nbsp;equal to the total. Your pool regains all expended dice when you finish a&nbsp; Long Rest .
1594403688
Magnar S.
Pro
API Scripter
Chris said: I believe the Celestial Warlock's " Healing Light " ability is missing (Xanathar's Guide). That one is indeed missing. Thanks! :) I have added it to the script found on github. You can use that straight away, or wait for it to release on the one-click installer. If you chose to wait, you can rename the "Healing Light" resource to "Healing Light [l]" (lower case L in brackets), and !long-rest will notice and refresh it based on the name postfix.
FYI Magnar -- After one of the script updates (around the time it became available on the one-click installer), the cool special-character arrows stopped displaying properly:
1595453363
Magnar S.
Pro
API Scripter
Chris said: FYI Magnar -- After one of the script updates (around the time it became available on the one-click installer), the cool special-character arrows stopped displaying properly. Thanks for letting me know, Chris. It seems this only happens with the one-click installer. If you choose "Import script" instead, then it works like it should. I'll have to report a bug for it.
Also FYI Magnar - I'm seeing an odd behaviour when using the "fades_after_short/long_rest." When the script toggles off the Global Damage Modifier for (say) Rage, it's also hiding the Atk and Damage/Type information in the "Attacks &amp; Spellcasting" area. It's not actually changing the content of those rows, just setting it to not display in the box on the Core Tab of the sheet. Maybe this is a bug with the sheetworker:
1595518416
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
It is a bug in the sheetworker. Try toggling the "Attack" checkbox off and on in each of those attack fields. It should work normally after that, though you will need to do this once for any attack you ad later.
1595522556
Magnar S.
Pro
API Scripter
There sure are a lot of weird things going on in this space. Thanks for the info, Keith.&nbsp;
1595528768
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
It think the main problem is that a lot of hands have touched the&nbsp;D&amp;D 5th Edition by Roll20 Sheet over the years. Not everyone approaches problem solving the same way. That particular issue was "fixed" a few months ago. It used to be that toggling the modifier programattically did nothing at all. Now at least there's a workaround.
1596394967

Edited 1596400947
One thing I noticed in my session last night is that for the single-classed Warlock, his spells did not restore on a long rest.&nbsp; Troubleshooting this myself, I noticed that if a character is level 1 that their spells are restored, but if they're level 3 character the spells are not.&nbsp; I'm guessing that the script looks at the PC's spells sequentially, and if it has 0 slots then it stops checking the rest of the spell list.&nbsp; The problem&nbsp; is that the OGL sheet as it's currently set up is that a level 3 warlock (for example) will have 0 Lv1 slots and 2 Lv2 slots. Not a hard thing to work around on my end since this script seems to work fine with everything else, but I just thought you would like to know.
1596403286
Magnar S.
Pro
API Scripter
Jerad said: One thing I noticed in my session last night is that for the single-classed Warlock, his spells did not restore on a long rest.&nbsp; Troubleshooting this myself, I noticed that if a character is level 1 that their spells are restored, but if they're level 3 character the spells are not.&nbsp; I'm guessing that the script looks at the PC's spells sequentially, and if it has 0 slots then it stops checking the rest of the spell list.&nbsp; The problem&nbsp; is that the OGL sheet as it's currently set up is that a level 3 warlock (for example) will have 0 Lv1 slots and 2 Lv2 slots. Not a hard thing to work around on my end since this script seems to work fine with everything else, but I just thought you would like to know. Hi Jerad. Thanks for the report. I've tested this plenty before, so I had to check for myself one more time. There is indeed something wrong: If you don't manually change the available spell slots at least once, then they are not changed by my script. However, once they have been changed, then the script works as intended. Do let me know if you see the same thing. Cheers!
Interesting, now it seems to work.&nbsp; The party leveled up recently so that may have something to do with why the player was having problems.&nbsp; Thanks!
I just found this script.&nbsp; I've been looking for a script like this so Thank You!&nbsp; Two things: 1.&nbsp; Reducing Exhaustion by 1 level may not be the correct thing to do automatically.&nbsp; Under D&amp;D 5e rules, there are two types of exhaustion: exhaustion that comes from lack of rest, and exhaustion that comes from not having enough food&amp;water (PHB p. 185).&nbsp; The first type of exhaustion can be reduced by 1 simply by resting.&nbsp; The second type can only be reduced by rest AND getting food&amp;water.&nbsp; In some modules, like Tomb of Annihilation, getting food&amp;water is not a given.&nbsp; Can I suggest that reducing exhaustion in your script be tied to an option that can be set so that if it's off, the exhaustion has to be adjusted manually and isn't automatically lowered by your script?&nbsp;&nbsp; 2.&nbsp; I'm not clear on how resetting the charges on wands is supposed to work.&nbsp; Maybe better instructions are needed?&nbsp; For example, am I supposed to create a resource called "Wand of Magic Missile"?&nbsp; Where do I put the dice roll code?
1596525663
Magnar S.
Pro
API Scripter
Hi Saul! I'm glad you found the script useful. :) Saul J. said: 1.&nbsp; Reducing Exhaustion by 1 level may not be the correct thing to do automatically.&nbsp; Under D&amp;D 5e rules, there are two types of exhaustion: exhaustion that comes from lack of rest, and exhaustion that comes from not having enough food&amp;water (PHB p. 185).&nbsp; The first type of exhaustion can be reduced by 1 simply by resting.&nbsp; The second type can only be reduced by rest AND getting food&amp;water.&nbsp; In some modules, like Tomb of Annihilation, getting food&amp;water is not a given.&nbsp; Can I suggest that reducing exhaustion in your script be tied to an option that can be set so that if it's off, the exhaustion has to be adjusted manually and isn't automatically lowered by your script?&nbsp;&nbsp; There are three options here, as far as I can tell, as long as the character sheet does not track food and water consumption: Always change exhaustion levels. You must then manually bump it up again if you're starving. Never change exhaustion levels. You must then manually bump it down. Change exhaustion levels based on a switch. You must then manually flip the switch. All of these options involve performing a manual task to do the right thing with exhaustion levels. I would say that #1 does the right thing most often out of the box. I can certainly see the case for #3, but I don't think it's worth the added hassle, especially since it's an individual issue - I can't add a global toggle, it'll have to be per character somehow. 2.&nbsp; I'm not clear on how resetting the charges on wands is supposed to work.&nbsp; Maybe better instructions are needed?&nbsp; For example, am I supposed to create a resource called "Wand of Magic Missile"?&nbsp; Where do I put the dice roll code? Yes, you create a resource called: Wand of Magic Missiles [l+1d6+1] The resource is then used to track the charges.
I see your point about Exhaustion.&nbsp; Either way, something has to be done manually.&nbsp; But, I'm not sure I get your point about not being able to set a global.&nbsp; Other scripts I've used seem to be able to set globals.&nbsp; All I'm suggesting is that there be a global setting for "Yes, change exhaustion for all characters" or "No, don't change exhaustion for all characters".&nbsp; I'm not clear why that can't be done.&nbsp; I think it would be useful for anyone running a "hard" D&amp;D game where they use rules like Exhaustion.&nbsp; Not all DMs bother with exhaustion, or food/water in general but many do. As for the resource: so the dice roll code goes into the Resource name?&nbsp; Is there a limit for the number of resources?&nbsp; As characters get more and more magic items, if there's a limit, they may run out of "resource space". Thanks!
1597152349
Magnar S.
Pro
API Scripter
Saul J. said: I see your point about Exhaustion.&nbsp; Either way, something has to be done manually.&nbsp; But, I'm not sure I get your point about not being able to set a global.&nbsp; Other scripts I've used seem to be able to set globals.&nbsp; All I'm suggesting is that there be a global setting for "Yes, change exhaustion for all characters" or "No, don't change exhaustion for all characters".&nbsp; I'm not clear why that can't be done.&nbsp; I think it would be useful for anyone running a "hard" D&amp;D game where they use rules like Exhaustion.&nbsp; Not all DMs bother with exhaustion, or food/water in general but many do. Sorry about my confusing statement - I'm not a native speaker. I didn't mean it was impossible. I only ment it wasn't particularly helpful. On a single day throught the jungles of Chult, maybe only two out of five party members have enough food. In this case, the global toggle wouldn't be of much use. It would basically only be useful in the case where a clear majority is in need of food, and then only to avoid a few adjustments. And if they keep up like that, soon all of them will be dead anyway.&nbsp; So, my point is this: A global toggle would be possible, but not useful enough to warrant programming, maintaining and documenting. At least, that is my opinion at the moment. I'm open for any opposing arguments. &nbsp; As for the resource: so the dice roll code goes into the Resource name?&nbsp; Is there a limit for the number of resources?&nbsp; As characters get more and more magic items, if there's a limit, they may run out of "resource space". Thanks! Yes, you add the dice roll code into the Resource name for magic items. It's not necessary for most class/race-based Resources, because I have enumerated them in code. If there is a limit to the number of resources you might add, I haven't encountered it personally.&nbsp;