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

Organizing separate dice rolls and highlighting

I am trying to figure out a way to reference the dice I roll for a game I'm in.  It's not a special module or anything, it's just basic tiles, images, and rolls. What I am currently using: Our system rolls three D20 and we use the median of the three.  This following line works because graphically, it shows three dice being rolled, and in the chat dialogue, it shows the results of each three dice (including modifiers).  It indicates rolls of 1 in red, and rolls of 20 in green.  It does not show the sum because that is not relevant. [[1d20 + ?{Bonus1}]],[[1d20 + ?{Bonus1}]],[[1d20 + ?{Bonus1}]] ?{Reason} What I would like to do: Highlight blue (I understand this is the third optional colour) the median dice.  I understand it is possible that it could also be a 1 or a 20, as duplicate rolls are possible. Thoughts: I believe that I would need to make each of these three rolls in a type of 'back end', calculate each result into a variable, (hey, sorting them would be cool and useful but not required), and after deciding the median, display the three outputs similar to how the original output is processed.  That's kind of the pseudocode going through my head, but I am completely new to anything scripty in Roll20, and so I come to here for help. :) Thank you for any help about this, I hope it's a fun challenge if possible, and not too much labour of an ask! Tim S.
1601953871
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Unfortunately, doing anything with the median would require the API (pro subscriber perk). 
Scott C. said: Unfortunately, doing anything with the median would require the API (pro subscriber perk).  Thank you for that info, even knowing it can't be done at basic level is an answer. Cheers!
1601964951

Edited 1601965150
Oosh
Sheet Author
API Scripter
Which part is important to you? You can just grab the median roll, if that's all you need: /r {3d20dh1}dl1 + ?{Bonus|0} But yeah... anything more sophisticated than that will need the API. Oh... you can also sort them if you wish, so the median die is always in the middle: /r {3d20sddh1}dl1 + ?{Bonus|0}
1601982397
David M.
Pro
API Scripter
That's nifty, Oosh!
1601987279
Oosh
Sheet Author
API Scripter
Totally stolen, too :)
1601988334
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Ooh, nice call. That would be a great way to get the median.