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

Health Potion Macro

Hi, I am currently creating a health potion macro but the biggest issue I am having is getting 1 roll to appear in 2 places. I figured out a way to remedy this but now I get a popup asking for a value. I was wondering if there was any way to automatically fill in this pop-up value. /em uses a Healing potion to Recover [[?{2d4+2 Result}]]  Hit Points !setattr --sel --mod --HP|[[?{2d4+2 Result}]]
1593125574
GiGs
Pro
Sheet Author
API Scripter
As it happens, a way was recently discovered to do this. It might be a bug so might stop working one day. But for now it works. !setattr --sel --mod --HP|[[2d4+2]] /em uses a Healing potion to Recover $[[0]]  Hit Points I've changed the order, because I'm pretty sure it wont work the other way around. Your syntax for the roll was a bit faulty. 
1593125684
GiGs
Pro
Sheet Author
API Scripter
Ah the previous post wont work. For the method I posted to work, the roll and the $[[0]] need to be on the same line. IIRC there's a way to that with setAttr but I'm rushing off for food and cant remember the syntax offhand.
1593125984
GiGs
Pro
Sheet Author
API Scripter
Try something like: &amp;{template:default} {{name=Healing Potion}} !setattr --sel --mod --HP|[[2d4+2]]!!! {{Healing=$[[0]]}} It's covered here:&nbsp; <a href="https://app.roll20.net/forum/permalink/6578447/" rel="nofollow">https://app.roll20.net/forum/permalink/6578447/</a> Now I really am off.
1593192903

Edited 1593208776
I use this macro, that makes you choose also the kind of potion you are using &amp;{template:default} {{name=Healing Potion}}{{?{Potion|Regular, **Healing Potion Used:** = [[2d4+2]]| Greater, **Greater Healing Potion Used:** = [[4d4+4]]| Superior, **Superior Healing Potion Used:** = [[8d4+8]]| Supreme, **Supreme Healing Potion Used:** = [[10d4+20]] } HP recovered}}
I'm sure there are variations on this floating around. I don't recall where I found this, but here is one that is very similar to Fat B's &amp;{template:desc} {{desc= ?{Choose a Potion of...|Healing, **Potion of Healing**: [[2d4+2]]|Greater Healing, **Potion of Greater Healing**: [[4d4+4]]|Superior Healing, **Potion of Superior Healing**: [[8d4+8]]|Supreme Healing, **Potion of Supreme Healing**: [[10d4+20]]|Keoghtom's Ointment, **Keoghtom's Ointment**: [[2d8+2]] and cured of poison and any disease} }} Good luck! M