Skip to content
This repository has been archived by the owner on Jan 13, 2023. It is now read-only.

Boolean condition and reversed boolean expression #101

Open
TheDGOfficial opened this issue Nov 17, 2019 · 0 comments
Open

Boolean condition and reversed boolean expression #101

TheDGOfficial opened this issue Nov 17, 2019 · 0 comments
Assignees
Labels
priority: medium A medium priority issue or pull request type: enhancement New feature or request type: feature A good feature
Milestone

Comments

@TheDGOfficial
Copy link
Member

Is your feature request related to a problem? Please describe.
Writing conditions like true is true # for representing literal true condition or false is true # for representing literal false condition is pointless. We should can be able to use things like while true and if false: # unreachable directly.

Also we can't use some not patterns in some conditions. Like for example if message not contains "a" does not work, doesn't contain instead of not contains works, though.

Describe the solution you'd like
Add a long waited CondBoolean and a reversed boolean expression that returns boolean and can be used as a condition.

Describe alternatives you've considered
N/A

Additional information
Pattern recommendations:

%boolean% # for while true: etc.
(!|inversed|reversed|not)%boolean% # for if message not contains "x" etc.

Note that the second one should return a boolean and should be an expression, not a condition. The CondBoolean will wrap it anyway, so we can also use it as a condition.

This way, we can make all conditions expressions that returns booleans, but we have many expressions and I'm not going to do so since expressions are taking more time to parse and we have many expressions.

We should also undeprecate the shortcut boolean condition from SkQuery, it is deprecated in an internal SkriptParser code that I'm forgotten. We can maybe try to override SkQuery's, since it is maybe bugged, if it is not already overridden.

Also if we make all conditions expressions, the result of condition %condition% # result of (condition|boolean) (<.+>[,]|%boolean%) pattern that used by ExprResultOfCondition and the Effect Commands will be useless, but we don't have any plans to remove conditions to make all of them expressions, so they can be last for a long time.

@TheDGOfficial TheDGOfficial added type: enhancement New feature or request type: feature A good feature priority: medium A medium priority issue or pull request labels Nov 17, 2019
@TheDGOfficial TheDGOfficial added this to the 2.2.18 milestone Nov 17, 2019
@TheDGOfficial TheDGOfficial self-assigned this Nov 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
priority: medium A medium priority issue or pull request type: enhancement New feature or request type: feature A good feature
Projects
None yet
Development

No branches or pull requests

1 participant