Viston Posted June 22, 2017 Share Posted June 22, 2017 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? Quote Link to comment Share on other sites More sharing options...
Explv Posted June 22, 2017 Share Posted June 22, 2017 (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 June 22, 2017 by Explv 3 Quote Link to comment Share on other sites More sharing options...
Viston Posted June 22, 2017 Author Share Posted June 22, 2017 (edited) 4 minutes ago, Explv said: myPlayer().getArea(radius) Thank you, appreciated Easier than I thought lol. Should have a better look at the api I guess kek Edited June 22, 2017 by Visty Quote Link to comment Share on other sites More sharing options...
Apaec Posted June 22, 2017 Share Posted June 22, 2017 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 2 Quote Link to comment Share on other sites More sharing options...
Viston Posted June 22, 2017 Author Share Posted June 22, 2017 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 1 Quote Link to comment Share on other sites More sharing options...