Rolisteam / DiceParser

Powerful dice Roller is used as discord bot, irc bot, cli tool and inside Rolisteam : 1d20+4, 1L[head,arm,leg,belly,chest], 1d6+1d8, 8+5*3
http://www.rolisteam.org/
GNU General Public License v3.0
125 stars 31 forks source link

if statement used as example does not work #68

Closed Jstenoien closed 4 years ago

Jstenoien commented 4 years ago

Hello, love this dice bot on Discord but as we were trying it out we noticed that this example from the HelpMe.md page does not actually work how it should:

2d10i:[>15]{"Success %1 [%2]"}{"Fail %1 [%2]"}
Same as above, but the result of each die is displayed inside square brackets.

The result of each die is not displayed inside square brackets, instead you get: Fail 7 []

Thanks for your awesome work!

OrangeMush28 commented 4 years ago

!2d10i:[>15]{"Success %1 [@2]"}{"Fail %1 [@2]"}

the % in the []'s needs to be @ and then it will display the die

JoeGans commented 4 years ago

Can I ask, If I change the 2d10i to 4d10i nothing happens ...

!4d10i:[>15]{"Success %1 [@2]"}{"Fail %1 [@2]"}

... What am I missing? ... Thanks, Walts

JoeGans commented 4 years ago

This line works OK for my issue...

!4d10i:[>15]{"Success %1 [$1] ~ [@1]"}{"Fail %1 [$1] ~ [@1]"}

RESULT Success 19 [19] ~ [2,8,5,4]

... So, the @1 is the key to fix things? ... Walts

obiwankennedy commented 4 years ago

perhaps the introduction of @ place holder broke some stuff. I will check that.