Rolisteam Dice Parser run dice commands. It is available on several platforms. The syntax is simple and powerful.
99.9%
uptime- Roll any kind of dice
- Customizable prefix
- Custom alias/macro to improve game experience
- Manage colorized dice
- Many operators
Roll 3 dice with 100 faces
Roll 10 dice with 10 faces, 10 explodes, and sort the result.
roll 100291 dice with 66666666666 faces and sort result
roll 15 dice with 10 faces and it counts number of dice which are above 7
roll 1 die with 8 faces and add the result to 2 dice with 6 faces and add 7.
roll 1 die with 25 faces
88 minus the value of 1 die of 20 faces
compute: 24
compute: 100/28 = 3 3*3 = 9
More examples at : https://github.com/Rolisteam/DiceParser/blob/master/HelpMe.md
The grammar is something like this:
Program =: Instruction [InstructionSeparator, Instruction]* Comment
InstructionSeparator = ;
Instruction =: Expression ([Operator, Expression]* | [Option]*)
Operator =: ScalarOperator
Expression =: OpenParenthesis Expression closeParenthesis
| Option*
| [Operator, Expression]*
| Operand Dice
| Command
| NodeOperator [Option]*
| ValuesList
| Dice (Operand == 1)
Operand =: DynamicVariable | Number | String
OpenParenthesis = (
closeParenthesis = )
OpenList = [
CloseList = ]
ListSeparator = ,
ValuesList=: OpenList (DynamicVariable | Number)? [ ListSeparator,(DynamicVariable | Number)]* CloseList
Dice =: DiceOperator [uniqueValue] DiceParameter
DiceOperator =: D ParameterDice | L ParameterList
DiceParameter =: ParameterDice | ParameterList
ParameterDice =: Number|Range
ParameterList =: List
List=: OpenList String[Probability] [ListSeparator,String[Probability]]* CloseList
Probability=: OpenList (Range|Percentage) CloseList
Percentage =: number
Option =: Keep
| KeepAndExplode
| Filter
| Sort
| Count
| Reroll
| RerollUntil
| RerollAndAdd
| Explode
| Merge
| Bind
| Occurences
| Unique
| Paint
| If
| Split
| Group
Range =: OpenList Number RangeSeparator Number CloseList
RangeSeparator =: -
ScalarOperator =: [x,-,*,x,/]
number =: [-] [0-9]+ | constantValue
OpenVaribale=: ${
CloseVariable=: }
constantValue =: OpenVaribale (id | label) CloseVariable
id=[_,a-z][_,A-z,0-9]* # must respect rules of QML id
label=.*
variable = OpenVaribale [0-9]+ CloseVariable
CompositeValidator =: OpenList Validator [LogicOpetator,Validator]* CloseList
LogicOpetator =: AND | XOR | OR
AND =: &
XOR =: ^
OR =: |
Ascendant=:l
Validator =: BooleanValidator | RangeValidator | OperationValidator
CompareOpetator =: = | > | >= | < | <= | !=
RangeValidator =: Range
OperationValidator =: Modulo operandNode BooleanValidator
Modulo =: %
BooleanValidator =: [=]Operand | [CompareOpetator Operand]
ListOfValue=: String[Range],ListOfValue | String[Range]
String =: .*[^ListSeparator]
Keep =: k[Ascendant] Number
KeepAndExplode =: K[Ascendant] number
Filter =: f CompositeValidator
Sort =: s[Ascendant]
Count =: c CompositeValidator
Reroll =: r CompositeValidator
RerollUntil =: R CompositeValidator
RerollAndAdd =: a CompositeValidator
Merge =: m
Bind =: b
Occurences =: OccurencesWidth ( ListSeparator number | CompositeValidator)
OccurencesWidth =: number
unique =: u
Painter =: p PainterParameters
PainterParameters =: OpenList PairColorOccurence [ListSeparator , PairColorOccurence]* CloseList
PairColorOccurence =: Color PairSeparator Number
PairSeparator =: :
If =: i [compareMethod] CompositeValidator Bloc[Bloc]
compareMethod =: OnEach | OneOfThem | AllOfThem | onScalar
OnEach =: ''
OneOfThem = '.'
AllOfThem = '*'
onScalar = ':'
Bloc =: OpenBranch Expression CloseBranch
OpenBloc =: {
CloseBloc =: }
Split =: y
Group =: g Number
Sort =: s
Group =: number
Explode =: e CompositeValidator
NodeOperator = Jumpbackward
Jumpbackward =: @
Merge =: m | m Expression
Command =: help | la
uniqueValue = u
Comment =: StartComment String
StartComment =: #