This repository has been archived by the owner on Jan 13, 2023. It is now read-only.
Boolean condition and reversed boolean expression #101
Labels
priority: medium
A medium priority issue or pull request
type: enhancement
New feature or request
type: feature
A good feature
Milestone
Is your feature request related to a problem? Please describe.
Writing conditions like
true is true # for representing literal true condition
orfalse is true # for representing literal false condition
is pointless. We should can be able to use things likewhile true
andif 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:
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.The text was updated successfully, but these errors were encountered: