idkclub / dicebot

🎲 /roll support for Slack
https://dicebot.idk.club
The Unlicense
53 stars 20 forks source link

Allow for multi-roll. #65

Closed yakuzadave closed 3 years ago

yakuzadave commented 3 years ago

I have been giving this a go and love it so far, but was curious if this supported something like multi-roll? This would look something like:

/roll 6 4d6k3

Rolling 6 iterations...
4d6kh3 (4, 2, 5, 2) = 11
4d6kh3 (6, 3, 6, 2) = 15
4d6kh3 (3, 1, 2, 2) = 7
4d6kh3 (3, 2, 1, 3) = 8
4d6kh3 (6, 1, 3, 3) = 12
4d6kh3 (3, 2, 1, 1) = 6

This could be pretty useful for something like rolling stats for D&D or rolling for a bunch of enemies at once.

arkie commented 3 years ago

As you may have noticed, it currently assumes that multiple rolls are added together (so it processes as 6 + 4d6k3)

If you do roll /roll 4d6k3 4d6k3 4d6k3 4d6k3 4d6k3 4d6k3 (or /roll mini 4d6k3 4d6k3 4d6k3 4d6k3 4d6k3 4d6k3 to avoid showing all the intermediary rolls), it should give you those numbers, at least?

Copying them out isn't as nice as having a shorthand, but I'm reluctant to make backwards-incompatible syntax changes :|

yakuzadave commented 3 years ago

Sounds good. I'll give it a go.