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 .
×

[Macro help] Available mathy functions

I know that you can do basic math rolls (such as [[2+4]] to get 6), but are there any additional math-related functions available? Specifically, I'm looking for something like min and max.
You can use the keep/drop syntax to wind up with min and max as described in the wiki. I'll be back in a second with an example.
One of us must be moving at near the speed of light, because "a second" turned into 25 minutes. So, if you wanted a minimum of 10 on a dice roll, you'd use something like: /r {[[3d6]], [[10]]}k1 --this rolls 3d6 compares it to 10 and reports the higher. For a maximum, you'd use the drop command like: /r {[[3d6]], [[10]]}dh1 --this rolls 3d6, compares it to 10 and reports the lower.
While I understand why you chose to do it that way, Dave, if you're looking to use the min/max function in another roll you can't use a double inline. Say you want to roll 3d6 ten sided dice, but a minimum of five dice. {[[3d6]],[[5]])kh1 would tell you how many dice to roll, but not let you roll them. /roll [[{3d6,5d1}kh1]]d10 would do that.
Sorry about the time dilation, Dave--I forgot to disengage my warp drive earlier. Thanks for the examples! In my specific case, I was looking to make a macro for my Cure Light Wounds spell (heals 1d8 + caster level (max 5)). Using [[1d8+{@level,5}dh1]] totally worked!
Brandon W. said: While I understand why you chose to do it that way, Dave, if you're looking to use the min/max function in another roll you can't use a double inline.../roll [[{3d6,5d1}kh1]]d10 would do that. Oh yeah. I'll admit I was having a bear of a time getting Roll20 to deal with the syntax and it took many attempts for what I thought was gonna be a few second thing. Then my two year old had a meltdown over not getting to watch videos of ducks on YouTube right that second...
Owen F. said: Sorry about the time dilation, Dave--I forgot to disengage my warp drive earlier. Thanks for the examples! In my specific case, I was looking to make a macro for my Cure Light Wounds spell (heals 1d8 + caster level (max 5)). Using [[1d8+{@level,5}dh1]] totally worked! You could also use [[1d8+@{Level}d1kh5]]