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

Comparing rolls

soo.. i am making a macro for my perception. I have this one ability that lets me roll 2 perception checks and choose the higher of the two. In a macro, how do i compare the results to output the bigger of the two. Ex: if(1d20+15 > 1d20+15) output the first result else output the second result
{1d20+15, 1d20+15}kh1
1434505652

Edited 1434506018
That doesnt seem to work :( it outputs 31 plus i want it to be "the sum of 1d20+15 vs the sum of 1d20+15" not die vs die Edit: i did some wrong math
oh wait... woops. it works
Haha, or you can do: [[{d20,d20}kh1 + 15]]
1434512000

Edited 1434512012
Jake M. said: Haha, or you can do: [[{d20,d20}kh1 + 15]] wow thanks that works much better and looks cleaner
1434514769

Edited 1434514871
the roll can actually be simplified down to [[2d20kh1 +15]] Incase you want it even cleaner that is...
1434552366
DK Heinrich
Marketplace Creator
Sheet Author
add on question... If you have an ability that lets you reroll a 1 on this check, if one of your results is a 1 the macro will reroll that die and re-compare with the rest of the results?
1434552926

Edited 1434553012
DXWarlock
Sheet Author
API Scripter
[[2d20kh1r<1]] Seems to work, it rolls a 2 and a 1..2 was higher, but it still rerolled the 1 to a 6 and returned it.
1434553101
DK Heinrich
Marketplace Creator
Sheet Author
sexy! thanks!
You may want to use "ro1" instead of "r1" depending on how your ability works. "r1" will reroll 1's until they are not 1's anymore, so "1d20r1" is equivalent to "1d19+1" (and "2d20r1" is equivalent to "(1d19+1)+(1d19+1)"), it just takes more computation to get there. "ro1" will reroll 1's once, and then take the reroll no matter what (even if it's a 1 again).
1434644819
DK Heinrich
Marketplace Creator
Sheet Author
actually the 1st option is what i needed for that instance, but other instances in the game I am working with (Shadow of the Demon Lord) has use for the 2nd option also. Thanks!