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

Syntax changed? Macros no longer working #67

Closed The24thPegasus closed 4 years ago

The24thPegasus commented 4 years ago

I've been using this bot to assist in writing a somewhat randomized CYOA story by asking it questions and returning results based on a number to indicate how likely something was to happen. It was working fine as of 3/20/2020, and now the macro no longer works (3/27/2020). Was something changed with how the bot parses code that would cause the macro to stop working?

The macro I used was the following: !macro f([0-9]+) 1d[0-11]i:[<=\1]{i:[0]{"Critical Success/Yes %1 (Needed: \1 or Less)"}{"Success/Yes %1 (Needed: \1 or Less)"}}{i:[11]{"Critical Fail/No %1 (Needed: \1 or Less)"}{"Fail/No %1 (Needed: \1 or Less)"}} 1

entering !f(number) on a scale of 0-9 would have the bot roll a number between 0-11 and check it against the provided number to determine success or failure (with special conditions for critical success or failure). This no longer works, and returns the following error:

Input: !f1 #Is there any trouble outside of the bar?

Warning: Unexpected character at 7 - end of command was ignored "]i:[<=1]{i:[0]{"Critical Success/Yes %1 (Needed: 1 or Less)"}{"Success/Yes %1 (Needed: 1 or Less)"}}{i:[11]{"Critical Fail/No %1 (Needed: 1 or Less)"}{"Fail/No %1 (Needed: 1 or Less)"}} #Is there any trouble outside of the bar?"

-10

Details:[1d[0-11]i:[<=1]{i:[0]{"Critical Success/Yes %1 (Needed: 1 or Less)"}{"Success/Yes %1 (Needed: 1 or Less)"}}{i:[11]{"Critical Fail/No %1 (Needed: 1 or Less)"}{"Fail/No %1 (Needed: 1 or Less)"}} #Is there any trouble outside of the bar? ()]

If somebody could explain to me what changed and what needs to be fixed, that would be much appreciated.

obiwankennedy commented 4 years ago

Yes, the range syntax has changed. Now, you should use: 1d[0..11]