Jump to content

Set a final radius from player position


Recommended Posts

Posted (edited)
5 minutes ago, Visty said:

So upon starting a script, I want the user to be able to enter a radius in form in integer. This will set a radius for e.g 15 tiles surrounding my player at the moment. The radius should be set, and never changed.

How would I approach this with the api?

In onStart, create a custom GUI or just use a dialogue to get the radius value from the user.

Then get the Area for that radius using:

myPlayer().getArea(radius)

And store it globally.

Edited by Explv
  • Like 3
Posted

If you're looking for a simple solution and don't want to go through the hassle of creating your own GUI, and this is the only data you want to input, consider using a JOptionPane. Just remember to check the data that's inputted and ensure that it's valid, and if not pop the option pane up again!

-Apa

  • Like 2
Posted
3 hours ago, Apaec said:

If you're looking for a simple solution and don't want to go through the hassle of creating your own GUI, and this is the only data you want to input, consider using a JOptionPane. Just remember to check the data that's inputted and ensure that it's valid, and if not pop the option pane up again!

-Apa

Thank you for your post. I've sorted out the GUI. Just wanted to know how to get the area, store it in a variable, then access it to my tasks. Nevertheless, I appreciate your post :doge:

  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...