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

Add More Conditions to runif #320

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

wilyt1
Copy link
Collaborator

@wilyt1 wilyt1 commented Dec 16, 2023

This pull request expands on the features mentioned in issue #25 by adding more conditions.

Declarations:

  • I declare that this contribution was created in whole or in part by me.
  • I declare that I have the right to submit this contribution under the terms of this repository's license and declarations.
  • I understand and agree that this contribution and a record of it are public, maintained permanently, and may be redistributed under the terms of this repository's license.

Copy link
Contributor

@Krcnos Krcnos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solid addition to the runif command! Just a few feedback changes to make it more intuitive and complete

end,

greaterThan = function(text, arg)
if tonumber(text) > tonumber(arg) then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At the moment you'd have to do runIf greaterThan 1 2 command and it would return true as 2 is greater than 1 but I think tonumber(text) > tonumber(arg) should be switched to tonumber(arg) > tonumber(text) to be a little more intuitive as you're comparing the argument against the text

end,

lessThan = function(text, arg)
if tonumber(text) < tonumber(arg) then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as line 39 comment, switch them

end,

greaterThanOrEqual = function(text, arg)
if tonumber(text) >= tonumber(arg) then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as line 39 comment, switch them

end,

lessThanOrEqual = function(text, arg)
if tonumber(text) <= tonumber(arg) then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as line 39 comment, switch them

Cmdr/BuiltInCommands/Utility/runif.lua Show resolved Hide resolved
@autonordev autonordev self-assigned this Apr 25, 2024
@autonordev
Copy link
Collaborator

@wilyt1 have you considered the comments from krcnos?

@wilyt1
Copy link
Collaborator Author

wilyt1 commented Apr 29, 2024

I've reviewed the feedback and explained why implementing those suggestions wouldn't work right now, mainly because of how the runif command is set up. You can check out the details here: link to the Discord conversation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants