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

crazy macro: lower of two attributes

1432873273

Edited 1432873977
Is there any crazy possible way to write a macro that will choose the lower value of two separate attributes? For instance, initiative in my system is 1d10 +(wits or dex) whichever is lower. I could just switch between these depending on the character, [[1d10! +@{selected|Wits} &{tracker}]] or [[1d10! +@{selected|Dex} &{tracker}]] but I'd love a macro that could adjust itself as a character progresses. Any Gurus wanna help me out and blow my mind?
1432874352
Diana P
Pro
Sheet Author
From the 'replicating Math Library functions' in the CSS Wizardry thread ( <a href="https://app.roll20.net/forum/post/882997/css-wizar" rel="nofollow">https://app.roll20.net/forum/post/882997/css-wizar</a>... ) [[1d10! +(((@{selected|Dex} + @{selected|Wits}) - abs(@{selected|Dex} - @{selected|Wits})) / 2) &{tracker} ]] (if you want max, then change the -abs() to +abs() ) :)
&lt;3 TY so much! I'm learning fast ;)
1432875487

Edited 1432875521
Or you could just use [[ 1d10! + { @{selected|Dex}, @{selected|Wits} }KL1 ]]
1432876846
Diana P
Pro
Sheet Author
/facepalm Of course. I've been spending so much time playing with code, I forgot we get kl in the rolls. *sigh*
:D
1432930343
Lithl
Pro
Sheet Author
API Scripter
Yeah, the thing from the CSS Wizards thread is really more for autocalc fields on a character sheet, since you can just use kl/kh in a roll.