multidice

Rolls up to 6 different groups of dice. Syntax: !multidice 2d4 5d6 1d10 2d12 1d20 Each group is summed, and if more than one type is rolled, the sum of all types will be shown at the end.

Privateunrated

Content

27 lines
{=(syn):. `!multidice 2d4 5d6 1d10 2d12 1d20`}
{=(help):Rolls up to 6 different groups of dice{syn}}
{=(error):Incorrect syntax{syn}}

{=(la):{lower:{args}}}{=():}
{=(die):{join(,):{la}}}
{=(dice1):{list(0):{die}}}
{=(dice2):{list(1):{die}}}
{=(dice3):{list(2):{die}}}
{=(dice4):{list(3):{die}}}
{=(dice5):{list(4):{die}}}
{=(dice6):{list(5):{die}}}

{=(sum):{join(+):{replace(d, ):{la}}}}
{=(numcheck):{if({m:trunc({sum})}=={m:trunc({sum}/1)}):true|false}}

{=(resultd1):{if({dice1}!=):{range:{m:trunc(1*{dice1(1):d})}-{m:trunc({dice1(1):d}*{dice1(2):d})}}}}
{=(resultd2):{if({dice2}!=):{range:{m:trunc(1*{dice2(1):d})}-{m:trunc({dice2(1):d}*{dice2(2):d})}}}}
{=(resultd3):{if({dice3}!=):{range:{m:trunc(1*{dice3(1):d})}-{m:trunc({dice3(1):d}*{dice3(2):d})}}}}
{=(resultd4):{if({dice4}!=):{range:{m:trunc(1*{dice4(1):d})}-{m:trunc({dice4(1):d}*{dice4(2):d})}}}}
{=(resultd5):{if({dice5}!=):{range:{m:trunc(1*{dice5(1):d})}-{m:trunc({dice5(1):d}*{dice5(2):d})}}}}
{=(resultd6):{if({dice6}!=):{range:{m:trunc(1*{dice6(1):d})}-{m:trunc({dice6(1):d}*{dice6(2):d})}}}}
{=(results):{m:trunc({join(+):{resultd1} {resultd2} {resultd3} {resultd4} {resultd5} {resultd6}})}}

{=(json):{"fields":[{if({dice1}!=):{"name":"​{dice1}","value":"​{resultd1}","inline":true}}{if({dice2}!=):,{"name":"​{dice2}","value":"​{resultd2}","inline":true}}{if({dice3}!=):,{"name":"​{dice3}","value":"​{resultd3}","inline":true}}{if({dice4}!=):,{"name":"​{dice4}","value":"​{resultd4}","inline":true}}{if({dice5}!=):,{"name":"​{dice5}","value":"​{resultd5}","inline":true}}{if({dice6}!=):,{"name":"​{dice6}","value":"​{resultd6}","inline":true}}{if({dice2}!=):,{"name":"SUM:","value":"​{results}","inline":false}}],"color":3092790}}

{{if({la}==help):help|{if({numcheck}==false):error|c:cembed {channel(id)} {json}}}}
Raw JSON
{
  "id": 97272,
  "created_at": "2019-12-09T18:05:04.000Z",
  "tag_name": "multidice",
  "nsfw": false,
  "owner_id": "129419437911572480",
  "uses": 24,
  "description": "Rolls up to 6 different groups of dice.\nSyntax: !multidice 2d4 5d6 1d10 2d12 1d20\n\nEach group is summed, and if more than one type is rolled, the sum of all types will be shown at the end.",
  "restricted": false,
  "shared": false,
  "deleted": false,
  "safe": "unrated",
  "hidden": false,
  "guild_id": "518252334975811604",
  "sharer": "129419437911572480",
  "content": "{=(syn):. `!multidice 2d4 5d6 1d10 2d12 1d20`}\n{=(help):Rolls up to 6 different groups of dice{syn}}\n{=(error):Incorrect syntax{syn}}\n\n{=(la):{lower:{args}}}{=():}\n{=(die):{join(,):{la}}}\n{=(dice1):{list(0):{die}}}\n{=(dice2):{list(1):{die}}}\n{=(dice3):{list(2):{die}}}\n{=(dice4):{list(3):{die}}}\n{=(dice5):{list(4):{die}}}\n{=(dice6):{list(5):{die}}}\n\n{=(sum):{join(+):{replace(d, ):{la}}}}\n{=(numcheck):{if({m:trunc({sum})}=={m:trunc({sum}/1)}):true|false}}\n\n{=(resultd1):{if({dice1}!=):{range:{m:trunc(1*{dice1(1):d})}-{m:trunc({dice1(1):d}*{dice1(2):d})}}}}\n{=(resultd2):{if({dice2}!=):{range:{m:trunc(1*{dice2(1):d})}-{m:trunc({dice2(1):d}*{dice2(2):d})}}}}\n{=(resultd3):{if({dice3}!=):{range:{m:trunc(1*{dice3(1):d})}-{m:trunc({dice3(1):d}*{dice3(2):d})}}}}\n{=(resultd4):{if({dice4}!=):{range:{m:trunc(1*{dice4(1):d})}-{m:trunc({dice4(1):d}*{dice4(2):d})}}}}\n{=(resultd5):{if({dice5}!=):{range:{m:trunc(1*{dice5(1):d})}-{m:trunc({dice5(1):d}*{dice5(2):d})}}}}\n{=(resultd6):{if({dice6}!=):{range:{m:trunc(1*{dice6(1):d})}-{m:trunc({dice6(1):d}*{dice6(2):d})}}}}\n{=(results):{m:trunc({join(+):{resultd1} {resultd2} {resultd3} {resultd4} {resultd5} {resultd6}})}}\n\n{=(json):{\"fields\":[{if({dice1}!=):{\"name\":\"​{dice1}\",\"value\":\"​{resultd1}\",\"inline\":true}}{if({dice2}!=):,{\"name\":\"​{dice2}\",\"value\":\"​{resultd2}\",\"inline\":true}}{if({dice3}!=):,{\"name\":\"​{dice3}\",\"value\":\"​{resultd3}\",\"inline\":true}}{if({dice4}!=):,{\"name\":\"​{dice4}\",\"value\":\"​{resultd4}\",\"inline\":true}}{if({dice5}!=):,{\"name\":\"​{dice5}\",\"value\":\"​{resultd5}\",\"inline\":true}}{if({dice6}!=):,{\"name\":\"​{dice6}\",\"value\":\"​{resultd6}\",\"inline\":true}}{if({dice2}!=):,{\"name\":\"SUM:\",\"value\":\"​{results}\",\"inline\":false}}],\"color\":3092790}}\n\n{{if({la}==help):help|{if({numcheck}==false):error|c:cembed {channel(id)} {json}}}}",
  "embed": "{}",
  "last_fetched": "2026-10-20T20:46:42.899Z"
}