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

Additional <operators/constructors> Needed #27

Open
leasoncre opened this issue May 13, 2020 · 3 comments
Open

Additional <operators/constructors> Needed #27

leasoncre opened this issue May 13, 2020 · 3 comments
Assignees
Labels
💡 Suggestion Suggestion to evolve the plugin

Comments

@leasoncre
Copy link

Request: additional functional operators needed for some use-cases:
Please add a function for:
<> (not equal to, opposite of "=" (or "!="))

ex:
currently I cannot test a string that changes constantly,
or have a set of commands run if the value returns false for the statement:
some placeholders can't be checked for an exact string value, but can be tested for a null/empty value
%luckperms_expiry_time_essentials.fly% returns a time value, but as a string ex:"1h 5m 3s"

add <if> placeholder:%luckperms_expiry_time_essentials.fly%<>""
add <msg> time remaining: %luckperms_expiry_time_essentials.fly%
add <endif>
add <msg> always msg

#==================lower priority/later on:
PS. can PAPI numerical values be tested for multiple values (with OR) the same way strings can?
ex: placeholder:%papi_value%=2|=4|=6 #(no spaces)
Is there an AND function?
ex: placeholder:%papi_value%=2 && %papi_value2%=test
or a multiple OR test on a single line?
ex: placeholder:%papi_value%=2 || %papi_value2%=test

There is a PlaceholderAPI MATH function that can do math functions with EvalEX, but that won't test multiple placeholders things in one statement. :/

Thank you.

@EpiCanard
Copy link
Collaborator

EpiCanard commented May 14, 2020

Hello :)

You can already reverse a condition with <if> [!]conditional operator key:parameters

Prefixing an operator key with ! will make that conditional check negative, so it will execute its block if the condition is FALSE rather than TRUE.

So why adding a new operator if you can just reverse the conditon ?

====
For papi you can already compare number with OR
placeholder:%papi_value%=2|4|6

For the AND and OR for multiple placeholder I thinks if it's added it should be available for every operator so maybe a new conditional types can be a good idea like and that can be used if it has an just above

@EpiCanard EpiCanard added the 💡 Suggestion Suggestion to evolve the plugin label May 14, 2020
@EpiCanard EpiCanard self-assigned this May 14, 2020
@leasoncre
Copy link
Author

leasoncre commented May 14, 2020

Hello :)
You can already reverse a condition with <if> [!]conditional operator key:parameters
Prefixing an operator key with ! will make that conditional check negative, so it will execute its block if the condition is FALSE rather than TRUE.
So why adding a new operator if you can just reverse the conditon ?

oh, i completely missed it.
A conditional IF statement is defined in this format: <if> [!]conditional operator key:parameters
I was looking in the BOLD ($) notes below the table for operators. :/
might? still be a need for it later? unknown. This should work just fine though. (main issue solved)

====
For papi you can already compare number with OR
placeholder:%papi_value%=2|4|6

For the AND and OR for multiple placeholder I thinks if it's added it should be available for every operator so maybe a new conditional types can be a good idea like and that can be used if it has an just above

For numbers, yes, but i was asking about STRINGS/text.
"if it has an just above"???? #typos ><
sounds good :)

Thank you.

@EpiCanard
Copy link
Collaborator

EpiCanard commented May 15, 2020

For numbers, yes, but i was asking about STRINGS/text.

You can do the same with strings :)

"if it has an just above"???? #typos ><

a new conditional types can be a good idea like <or> and <and> that can be used if it has an <if> just above

Not typos, just github that interprets <>

@serversigns serversigns deleted a comment from leasoncre Feb 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💡 Suggestion Suggestion to evolve the plugin
Projects
None yet
Development

No branches or pull requests

2 participants