testttmewmc 3 Share Posted July 7, 2022 public static void zoomCameraOut() { if (Camera.getZoom() > 537) { MethodProvider.log("Zooming out"); if (Camera.setZoom(537)) { MethodProvider.sleepUntil(() -> Camera.getZoom() <= 537, 600); } } } When executing this bit of code, the bot will zoom out until it's at zoom level 561, but cannot zoom all the way out to 537 (max zoom dist) for some reason... any ideas? Link to comment Share on other sites More sharing options...
Pandemic 2723 Share Posted July 8, 2022 setZoom isn't exact due to the nature of how it works with scrolling so there is a tolerance. If you need finer control I'd recommend implementing it yourself using Mouse#scrollWhile. Link to comment Share on other sites More sharing options...
testttmewmc 3 Author Share Posted July 16, 2022 On 7/8/2022 at 4:36 PM, Pandemic said: setZoom isn't exact due to the nature of how it works with scrolling so there is a tolerance. If you need finer control I'd recommend implementing it yourself using Mouse#scrollWhile. Figured out you can just do .setZoom(500) and it'll scroll down to 537. Just had to tell it to scroll to less than possible? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now