Comments (2)
Hi,
Thanks for the report.
My answer is in English, as you can see :-).
It may help more people this way.
I explain the @ operator in the documentation of DiceParser (helpMe.md file).
The command segfault because you don't have two results in the execution tree.
DiceParser builds execution tree and run it.
In your example, the execution tree is made of:
Number Node (8) -> DiceRollingNode (D20) -> scalar operator node(+) -> NULL
-> Number Node (10) -> scalar operator node(*) -> NULL
-> Number Node (10) -> scalar operator node(*) ->
-> jumping backward @ -> countingNode (=20)
(Scalar operator has two children the next node and the internal node).
The jumping backward operator tries to reverse browser the tree to find the second dice result. It will not return the first result but the second one. Returning the first previous result is the normal behaviour (without the @).
So, the command will never work. I will fix the bug to prevent the segfault, but It will display error message.
I plan to implement a if operator, to execute any command if the condition is true.
The command will be 1d20i20{+10}, something like that.
in {}, it will be possible to add command to modify the result, or to run another command. As in warhammer (v2):
Assuming 46 is the value of the skill.
1d100i[<46]{1d10i10{1d100i[<46]{10+1d10e10}}}
Roll 1d100 if lesser than 46, then roll damage : 1d10.
If the damage roll gives 10, so roll again the skill test to check if the critical is confirmed.
If the critical is confirmed, run 10+1d10e10. It will give the final damage result.
I plan to do something like that.
It will allow combination of several dice, the main technical issue is to know what to display to the user.
from diceparser.
thanks for the quick fix :)
from diceparser.
Related Issues (20)
- Problems with rerolling HOT 3
- Macros activated from comment (#) and sentence display ("") HOT 1
- Exploding Doubles HOT 1
- No valid value at index HOT 5
- Question re: Syntax for an IF statement based on an Entered Number and a Dice Roll. HOT 2
- Bot stopped working with Discord's latest version HOT 6
- Prefix not working HOT 3
- All dice prefix commands not working HOT 3
- Diceparser not working with webhook
- DiceParser not working September 2022 HOT 1
- /r works but ! does not HOT 5
- Help Noob please! Bot Setup steps for RPG HOT 2
- Weird handling of numbers in lists
- Bot frequently does not respond
- Bot Not Responding In Any Server
- bot does not allow users below the rank of admin to roll HOT 3
- Broken example in HelpMe.md HOT 1
- List weight doesn't seem to work
- Dice Parse offline? HOT 2
- Ambiguous licensing HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from diceparser.