Code Monkey home page Code Monkey logo

Comments (16)

obiwankennedy avatar obiwankennedy commented on June 7, 2024

Are you sure of your example?
As far as I understood, rolling 77 after 3 temp pass, should give a temp pass.

51-95
After one temp pass it becomes
46-100 or 41-95
Second one:
36-95.

DiceParser won't be able to store previous rolls or values.
But it is possible to pass modificaters and compute appropriate range

from diceparser.

ninjatommy21 avatar ninjatommy21 commented on June 7, 2024

I went ahead and closed this as I found another solution using DiceParcer and Google Sheets.

To clarify. The temp pass or temp fail regions would never increase. Receiving those rolls increase the full pass and full fail regions.

!d100i[>95]{"full pass %1"}i[>50]{"temp pass %1"}i[>5]{"temp fail %1"}{"full fail %1"}

This is the base that it's using.
Using Google sheets i can set up ifs statements regarding cells that players can input how many temp passes and temp fails they have received.

Thus is they 2 temp fails and 3 temp passes the Google sheet will output the following
!d100i[>65]{"full pass %1"}i[>50]{"temp pass %1"}i[>25]{"temp fail %1"}{"full fail %1"}
For my players to use on the DiceParcer Bot.

The original idea was to see if it was possible to only use DiceParcer. Using the Macro Feature that allows you to submit 2 values that end up replacing values in the Macro. - The regular-expression

I played around with this and was able to figure out how it assigns the values. with the \1 and \2 in the example provided on the Documentation.

However I was unable to figure out a way for it to edit roll result even with the ability to have the macro enter \1 and \2 as the number of times you have temp passed for failed

This is why I defaulted to using a combination of DiceParcer and Google Sheets.

from diceparser.

ninjatommy21 avatar ninjatommy21 commented on June 7, 2024

1
2
3

The provided snippets are of the Google Sheet and the three formulas used for how I got my desired outcome.

from diceparser.

obiwankennedy avatar obiwankennedy commented on June 7, 2024

You are on the right way. Give me some time and I will go back to you with macro that make the use of Google sheet less important and useful

from diceparser.

ninjatommy21 avatar ninjatommy21 commented on June 7, 2024

Take your time. Thank you.

from diceparser.

obiwankennedy avatar obiwankennedy commented on June 7, 2024

this macro:

!macro ninja([0-9+),([0-9+) d100;5+\1*5;96-\2*5;$1i[<$2]{"full fail $1"}i[<51]{"temp fail $1"}i[<$3]{"temp pass $1"}{"full pass  $1"} 1

to call it : "ninja0,0", "ninja2,3" ....

from diceparser.

ninjatommy21 avatar ninjatommy21 commented on June 7, 2024

This is perfect. It took a moment to understand why it wasn't working though. Seems a ] was missing after both the 9s.
Once I fixed that it worked perfectly.
Thank you so much

from diceparser.

ninjatommy21 avatar ninjatommy21 commented on June 7, 2024

There seemed to be some minor issues. However your code gave me an accurate example of how I can use the macro function. Thus I was able to reverse engineer it and change to numbers I needed to accordingly.

And thanks to your help I now know how to do this in the future should I ever need something complex like this.
Thank you So much
You are awesome!

from diceparser.

ninjatommy21 avatar ninjatommy21 commented on June 7, 2024

!macro ninja([0-9]+),([0-9]+) d100;5+\1*10;95-\2*10;$1i[>$3]{"full pass $1"}i[>50]{"temp pass $1"}i[>$2]{"temp fail $1"}{"full fail $1"} 1

the different is that the change is suppose to be by 10 and not 5. And I've set them in greater than order. Personal preference.
Functions the same.

from diceparser.

ninjatommy21 avatar ninjatommy21 commented on June 7, 2024

I do have another question. Is it possible to set it so nothing above a certain number is accepted.
The way this works that that have any number above 4 would essentially break the code.

And if you can limit it would it be as follows.
ninja([0-4]+),([0-4]+)

or

ninja([0-4]),([0-4])
?

from diceparser.

obiwankennedy avatar obiwankennedy commented on June 7, 2024

I think it is:
ninja([0-4]),([0-4])

the + at the end means "At least one or more"

from diceparser.

ninjatommy21 avatar ninjatommy21 commented on June 7, 2024

Thanks

from diceparser.

ninjatommy21 avatar ninjatommy21 commented on June 7, 2024

!macro ninja([0-9]+),([0-9]+),([0-9]+) d100+\3;5+\1*10;95-\2*10;$1i[>$3]{"full pass $1"}i[>50]{"temp pass $1"}i[>$2]{"temp fail $1"}{"full fail $1"} 1

I've seem to run into another issue that I can't seem to get past. The issue occurs if it's ran as a macro. Or if I simplify it as a regular dice roll
!d100+10;5;95;$1i[>$3]{"full pass $1"}i[>50]{"temp pass $1"}i[>$2]{"temp fail $1"}{"full fail $1"}

It seems that any modification to the dice rolls breaks it. I've tested this using the $ command as well. To have the dice roll in the first instruction and then edit the value in the second. Doing either results in this break. Where is just lists the numbers. I've included two screenshots to show this off.
If it isn't possible to edit the roll let me know as this limits other possible macros. Such as tests of strengths between players both using their buffs.

4
5

from diceparser.

obiwankennedy avatar obiwankennedy commented on June 7, 2024

!1d100+10;5;95;$1i:[>$3]{"full pass $1"}{$1i:[>50]{"temp pass $1"}{$1i:[>$2]{"temp fail $1"}{"full fail $1"}}}

from diceparser.

obiwankennedy avatar obiwankennedy commented on June 7, 2024

With more details, as you put +10 at the end of dice roll, it change the result type from dicelist to number. And the bare if expects a dicelist as previous node.
The : asks the ifs to evaluate on number value

from diceparser.

ninjatommy21 avatar ninjatommy21 commented on June 7, 2024

Thanks.
This worked wonders and I was able to put it to work on other macros. I appreciate all your assistance!

from diceparser.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.