-
-
Notifications
You must be signed in to change notification settings - Fork 2
Boolean condition and reversed boolean expression #101
Description
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.