Skip to content
New issue

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

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

Already on GitHub? # to your account

loop-value-X Detection #2382

Closed
Whimsyturtle opened this issue Aug 18, 2019 · 1 comment
Closed

loop-value-X Detection #2382

Whimsyturtle opened this issue Aug 18, 2019 · 1 comment
Labels
bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. completed The issue has been fully resolved and the change will be in the next Skript update. priority: low Issues that are not harmful to the experience but are related to useful changes or additions.

Comments

@Whimsyturtle
Copy link
Member

Whimsyturtle commented Aug 18, 2019

Description

When trying to subtract from a nested loop-value, the parsing of the minus symbol becomes glitchy

Steps to Reproduce

command /test:
    trigger:
        loop 3 times:
            loop 3 times:
                broadcast "%loop-value-1-1%"

Will yield the following parse error:
image

command /test:
    trigger:
        loop 3 times:
            loop 3 times:
                broadcast "%loop-value-1 - 1%"

Will yield the following parse error:
image
This shows that Skript is trying to parse loop-value-X where X is the nested loop order in this case as X being 1 - 1 for some reason

Expected Behavior

command /test:
    trigger:
        loop 3 times:
            loop 3 times:
                broadcast "%(loop-value-1)-1%"

Yields no parsing errors (intended behavior)

command /test:
    trigger:
        loop 3 times:
            loop 3 times:
                broadcast "%loop-value-1+1%"

Yields no parsing errors when performing addition instead of subtraction (no bracketing required at all for addition for some reason)

Errors / Screenshots

Listed above.

Server Information

  • Server version/platform: Spigot 1.14.4
  • Skript version: Skript 2.4-beta5

Additional Context

Skript should stop detecting the nested loop-value's order after it has hit a non-numeral character, like space characters or another minus symbol. Since at present it seems to break with these 2 characters, but work perfecting fine with the plus symbol.

@TheBentoBox TheBentoBox added bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. priority: low Issues that are not harmful to the experience but are related to useful changes or additions. labels Aug 26, 2019
@iWanheda
Copy link

iWanheda commented Sep 1, 2019

You can fix that with ( ( loop-value-1 ) - 1 )

@TPGamesNL TPGamesNL added the PR available Issues which have a yet-to-be merged PR resolving it label Aug 16, 2021
@TPGamesNL TPGamesNL added completed The issue has been fully resolved and the change will be in the next Skript update. and removed PR available Issues which have a yet-to-be merged PR resolving it labels Oct 30, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. completed The issue has been fully resolved and the change will be in the next Skript update. priority: low Issues that are not harmful to the experience but are related to useful changes or additions.
Projects
None yet
Development

No branches or pull requests

5 participants