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

A specific type of 'grouping rolled dice' macro?

So I was wondering if a macro can be made to roll a certain number of dice, and then group them together by their numbers rolled, and give the highest total as a result? For example, if I roll 7 dice and get 1, 3, 3, 3, 5, 5 & 8, the result would be 10, since two 5's is higher than three 3's or one 8.  I could always just roll and sort it, but if this macro could be made that would be excellent, since the thing I'm thinking of could roll up toward 30+ dice at late game.
It's a bit messy, takes a bit of time to roll, and requires a second click to show results but this will handle it for you. [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ ?{Dice|30}d8<7 ]] ]]d7<6 ]] ]]d6<5 ]] ]]d5<4 ]] ]]d4<3 ]] ]]d3<2 ]] ]]d2<1 ]] ]] {{Rolling ?{Dice}d8=[Show Results](!/
[[ {8*[[?{Dice}-$[[1]] ]], 7*[[ $[[1]]-$[[3]] ]], 6*[[ $[[3]]-$[[5]] ]], 5*[[ $[[5]]-$[[7]] ]], 4*[[ $[[7]]-$[[9]] ]], 3*[[ $[[9]]-$[[11]] ]], 2*[[ $[[11]]-$[[13]] ]], [[ $[[13]] ]]}k1 ]] &&{template:default}{template:default} {{8s:$[[0]] 7s:$[[1]]=**6s:$[[2]] 5s:$[[3]]**}} {{4s:$[[4]] 3s:$[[5]]=**2s:$[[6]] 1s:$[[7]]**}} {{Result=$[[8]]}})}} It will give a breakdown of how many of each die value was rolled and the final result.
Wow, are you an actual wizard? This works perfectly. Is it possible for it to roll d4's, d6's, d8' d10's and d12's, or does this require 5 separate macros?
I have been previously described as an inter-dimensional being. This version will support d4's to d12's [[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]] [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ ?{Dice|30}d[[ (1+{0,?{Die Size|4|6|8|10|12} }>12f<11)*12]]<11 ]] ]]d[[ (1+{0,?{Die Size} }>11f<10)*11 ]]<10 ]] ]]d[[ (1+{0,?{Die Size} }>10f<9)*10 ]]<9 ]] ]]d[[ (1+{0,?{Die Size} }>9f<8)*9 ]]<8 ]] ]]d[[ (1+{0,?{Die Size} }>8f<7)*8 ]]<7 ]] ]]d[[ (1+{0,?{Die Size} }>7f<6)*7 ]]<6 ]] ]]d[[ (1+{0,?{Die Size} }>6f<5)*6 ]]<5 ]] ]]d[[ (1+{0,?{Die Size} }>5f<4)*5 ]]<4 ]] ]]d4<3 ]] ]]d3<2 ]] ]]d2<1 ]] ]] }} {{Rolling ?{Dice}d?{Die Size}=[Show Results](!/
[[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[0]][[ {2*[[ ?{Dice} - $[[24]] ]], 11*[[ $[[24]] - $[[26]] ]], 10*[[ $[[26]] - $[[28]] ]], 9*[[ $[[28]] - $[[30]] ]], 8*[[ $[[30]] - $[[32]] ]], 7*[[ $[[32]] - $[[34]] ]], 6*[[ $[[34]] - $[[36]] ]], 5*[[ $[[36]] - $[[38]] ]], 4*[[ $[[38]] - $[[40]] ]], 3*[[ $[[40]] - $[[42]] ]], 2*[[ $[[42]] - $[[44]] ]], [[ $[[44]] ]] }k1 ]] &&{template:default}{template:default} &#$[[19]];{12s:$[[15]] 11s:$[[16]]=10s:$[[17]] 9s:$[[18]]}} &#$[[20]];{=10s:$[[17]] 9s:$[[18]]}} &#$[[21]];{8s:$[[19]] 7s:$[[20]]=6s:$[[21]] 5s:$[[22]]}} &#$[[22]];{=6s:$[[21]] 5s:$[[22]]}} ]] {{4s:$[[23]] 3s:$[[24]]=2s:$[[25]] 1s:$[[26]]}} {{Result=$[[27]]}} )}} [[[ [[{0,?{Die Size} }>12*91+32]] [[{0,?{Die Size} }=10*91+32]] [[{0,?{Die Size} }>8*91+32]] [[{0,?{Die Size} }=6*91+32]]