Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

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

License

GPL-3.0, GPL-2.0 licenses found

Licenses found

GPL-3.0
LICENSE
GPL-2.0
COPYING.txt
NotificationsYou must be signed in to change notification settings

Rolisteam/DiceParser

Repository files navigation

Logo

DiceParser

Rolisteam Dice Parser run dice commands. It is available on several platforms.The syntax is simple and powerful.

Full documentation here

Discord Bots

Features

  • 99.9% uptime
  • Roll any kind of dice
  • Customizable prefix
  • Custom alias/macro to improve game experience
  • Manage colorized dice
  • Many operators

Examples:

3D100

Roll 3 dice with 100 faces

10D10e[=10]s

Roll 10 dice with 10 faces, 10 explodes, and sort the result.

100291D66666666s

roll 100291 dice with 66666666666 faces and sort result

15D10c[>7]

roll 15 dice with 10 faces and it counts number of dice which are above 7

1D8+2D6+7

roll 1 die with 8 faces and add the result to 2 dice with 6 faces and add 7.

D25

roll 1 die with 25 faces

88-1D20

88 minus the value of 1 die of 20 faces

8+8+8

compute: 24

100/28*3

compute: 100/28 = 33*3 = 9

More examples at :https://invent.kde.org/rolisteam/rolisteam-diceparser/-/blob/master/HelpMe.md

Grammar

The grammar is something like this:

Program =: Instruction [InstructionSeparator, Instruction]* CommentInstructionSeparator = ;Instruction =: Expression ([Operator, Expression]* | [Option]*)Operator =: ScalarOperatorExpression =: OpenParenthesis Expression closeParenthesis| Option*| [Operator, Expression]*| Operand Dice| Command| function| NodeOperator [Option]*| ValuesList| Dice (Operand == 1)Operand =: DynamicVariable | Number | StringOpenParenthesis = (closeParenthesis = )OpenList = [CloseList = ]ListSeparator = ,ValuesList=: OpenList (DynamicVariable | Number)? [ ListSeparator,(DynamicVariable | Number)]*  CloseListDice =: DiceOperator [uniqueValue] DiceParameterDiceOperator =: D ParameterDice | L ParameterListDiceParameter =: ParameterDice | ParameterListParameterDice =: Number|RangeParameterList =: ListList=: OpenList String[Probability] [ListSeparator,String[Probability]]* CloseListProbability=: OpenList (Range|Percentage) CloseListPercentage =: numberfunction =: functionName OpenParenthesis [function_args] closeParenthesisfunction_args =: Instruction [InstructionSeparator, Instruction] | Operand | ValidatorListfunctionName =: repeatOption =: Keep| KeepAndExplode| Filter| Sort| Count| Reroll| RerollUntil| RerollAndAdd| Explode| Merge| Bind| Occurences| Unique| Paint| If| Split| GroupRange =: OpenList Number RangeSeparator Number CloseListRangeSeparator =: ..ScalarOperator =: [x,-,*,x,/,**]number =: [-] [0-9]+ | constantValueOpenVaribale=: ${CloseVariable=: }constantValue =: OpenVaribale (id | label) CloseVariableid=[_,a-z][_,A-z,0-9]* # must respect rules of QML idlabel=.*variable = OpenVaribale [0-9]+ CloseVariableValidatorList =: OpenList CompareMethod Validator [LogicOpetator CompareMethod Validator]* CloseListLogicOpetator =: AND | XOR |  ORCompareMethod =: Each |  All | Scalar | ANYEach=:All=: *Scalar=: :ANY=: .AND =: &XOR =: ^OR =: |Ascendant=:lValidator =: BooleanValidator | RangeValidator | OperationValidatorCompareOpetator =: = | > | >= | < | <= | !=RangeValidator =: RangeOperationValidator =: Modulo operandNode BooleanValidatorModulo =: %BooleanValidator =: [=]Operand | [CompareOpetator Operand]ListOfValue=: String[Range],ListOfValue | String[Range]String =: .*[^ListSeparator]Keep =: k[Ascendant] NumberKeepAndExplode =: K[Ascendant] numberFilter =: f ValidatorListSort =: s[Ascendant]Count =: c ValidatorListReroll =: r ValidatorListRerollUntil =: R ValidatorListRerollAndAdd =: a ValidatorListMerge =: mBind =: bOccurences =: OccurencesWidth ( ListSeparator  number | ValidatorList)OccurencesWidth =: numberunique =: uPainter =: p PainterParametersPainterParameters =: OpenList PairColorOccurence [ListSeparator , PairColorOccurence]* CloseListPairColorOccurence =: Color PairSeparator NumberPairSeparator =: :If =: i [compareMethod] ValidatorList Bloc[Bloc]compareMethod =: OnEach | OneOfThem | AllOfThem | onScalarOnEach =: ''OneOfThem = '.'AllOfThem = '*'onScalar = ':'Bloc =: OpenBranch Expression CloseBranchOpenBloc =: {CloseBloc =: }Split =: yGroup =: g NumberSort =: sGroup =: numberExplode =: e ValidatorListNodeOperator = JumpbackwardJumpbackward =: @Merge =: m | m ExpressionCommand =: help | launiqueValue = uComment =: StartComment StringStartComment =: #

Compilation

git clone --recursive https://invent.kde.org/rolisteam/rolisteam-diceparser.gitcd rolisteam-diceparsermkdir buildcd buildcmake ../ -DBUILD_CLI=ONmakesudo make install

About

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

Topics

Resources

License

GPL-3.0, GPL-2.0 licenses found

Licenses found

GPL-3.0
LICENSE
GPL-2.0
COPYING.txt

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp