Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken example in HelpMe.md #157

Open
ZeldaZone opened this issue Mar 4, 2023 · 1 comment
Open

Broken example in HelpMe.md #157

ZeldaZone opened this issue Mar 4, 2023 · 1 comment

Comments

@ZeldaZone
Copy link

ZeldaZone commented Mar 4, 2023

The example below does not appear to work as described, at least when using the Discord bot.

8d10;$1c[>6];$1c1;$2-$3i:[>0]{"%3 Success[%2]"}{i:[<0]{"Critical fail %3 [%2]"}{"Fail %3 [%2]"}}

Critical Fail will never occur, Fail will occur with numbers higher than 0 (the example says >1 is a success, 0 is fail, <0 is critical fail). Success will happen with lower numbers than Failure.

Perhaps due to the error, I can't tell what the code is doing well enough to fix it. Something's just completely wrong, the example really could go into more detail into what $1c[>6];$1c1;$2-$3 is doing, I think I get the rest, though since it doesn't work, I'm not really sure.

More trivially, the %3 for Success outputs first, while the success count is displayed after for all other ones. It should be moved to after the word for consistency.

@obiwankennedy
Copy link
Member

obiwankennedy commented Mar 8, 2023

Try this: 8d10;$1c[>6];$1c1;$2-$3;$4i:[>0]{"%3 Success[%2]"}{i:[<0]{"Critical fail %3 [%2]"}{"Fail %3 [%2]"}}
That should do the job.
But to be up to date it is better to use $ or @ place holder instead of %.

% displays the last result of the given instruction.
@ displays the last dice result of the given instruction.
$ displays the last number result of the given instruction.

So the command should be:
8d10;$1c[>6];$1c1;$2-$3;$4i:[>0]{"Success: $4 [@1]"}{i:[<0]{"Critical fail $4 [@1]"}{"Fail $4 [@1]"}}

  1. 8d10 -> roll [5,7,1,2,4,3,8,10]
  2. Count how many dice are higher than 6 (in the dice result of instruction one)
  3. count how many dice are equal to 1 (in the dice result of instruction one)
  4. 6's count - 1's count = success count
  5. if success count is higher than 0 -> success
    if it is lesser than 0 -> critical fail
    if it is 0 -> normal fail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants