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] healBot - allows characters who roll healing to apply it using automatic buttons in chat!

1657911118

Edited 1658095673
EE
Pro
"Ok I feed you a Health Potion". =>  "How much do I heal?" =>  "Shall I roll or you?" =>  "What type is it?" => "4d4+4" => "Ok, you rolling?"... *5hrs later* Sound familiar? healBot allows player characters who roll healing to apply it to either themselves or other tokens, inspired by Oosh's amazing autoButtons healBot (click to play gif) healBot is a minimal script that works with the Official D&D 5e Sheet. It listens for rolls that you might need to heal using and then responds by placing healing buttons into chat after the message that can be used to either heal the character who rolled or a target (who you then click on). The two types of situation that it works in are: "damage" rolls with the type "healing" or "heal" (case insensitive) hit dice being rolled (in this case it has to be the form from the sheet that is formatted*) * This is the only way the sheet actually sends more than a raw dice roll and so that the script can know what the dice is. Even regardless of that it is actually far better as UI/UX. You can enable this on the character sheet by toggling "track hit dice per class" to "on", and then clicking the "hit dice" text at the bottom of the box to allow rolling of a variable amount of hit dice at once.  No I have no idea why this is the only way to roll multiple hit dice, actually have hit dice formatted, or why the rolling button is kinda hidden. It's not like this functionality is related to the actual multi-classing/multiple hit-dice issue. For hit dice, healBot will only post the heal-self button. For any damage roll with the type of healing or heal it will post both. Script/Mod Link While my coding had improved a bit when I made this it was still a bit naff (not that much has changed) and it is not object oriented or particularly well setup. Critique appreciated! Get the script/mod/API/code here (link) Optional Recommendation: Stylebot with DrakonCSS As with all "inline-chat" type messages that are meant to supplement existing messages (and quite honestly, as with Roll20 in general) I strongly  recommend using Stylebot along with some custom CSS overrides on the client-side to make it much prettier and more useable from a UX/UI standpoint. I use my own custom overhaul designed to match the theming of the Official D&D 5e Sheet/Compendium (as consistent as they are), called DrakonCSS (cos I had to name it something). You can get that here. Version History v0.01  - Working release v0.02 - Critical bug fixed regarding requirement for unreleased script that would cause a crash
1657916388
GiGs
Pro
Sheet Author
API Scripter
I havent tested them (I didn't play 5e), but this is a great idea for a script.
1657918501
The Aaron
Roll20 Production Team
API Scripter
Nice Addition!  (Lol: Chat Bullocks!)
GiGs said: I havent tested them (I didn't play 5e), but this is a great idea for a script. Thanks, running shows it certainly was one of the bigger random slowdowns where people would suddenly stop to exchange what to do about the healing! The Aaron said: Nice Addition!  (Lol: Chat Bullocks!) Haha, I almost forgot that was in this one! I've since moved those common functions to a utility package with more recent work - I just hope I left that line in there! And thanks for being a forum legend btw. Having gone from zero knowledge to scripting a bunch of things (poorly) has been largely due to the open examples and explanations on the forums of which yours have been no small part.
1658055683
Andreas J.
Forum Champion
Sheet Author
Translator
How easy would it be to extend/modify the mod to work with other sheets that uses different attributes for tracking HP?
Andreas J. said: How easy would it be to extend/modify the mod to work with other sheets that uses different attributes for tracking HP? Depends on on a few factors. The script detects that something is healing by parts of the rolls templates For the "dmg" template the "damage type" given to it (line 12-24) For simple rolls the "rname" being hit-dice-u (lines 33-40) However it then allow takes the rolls for healing and applies them to tokens or characters in ways quite specific to the sheet detects if npc or PC (lines 92-96) presumable hp is still called "hp"? (lines 136-140) hp is hardcoded to bar1 in this script since I've never really encountered otherwise especially in D&D 5e Roll20 which it's made for (lines 180-181 and more) Worst, to get the character from the roll to self-apply this can only be done (since roll20 doesn't provide ID in roll) by taking the character name in the message and then searching for the sheet (lines 199-223) so that will be very different potentially. So... maybe. Really depends on the other sheet I'm afraid! I hope that that is a quick summary of the key parts. It is totally possible though (depending on the sheet and what it sends to chat).