testttmewmc 3 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?
Pandemic 2853 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.
testttmewmc 3 Author 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?
Recommended Posts
Archived
This topic is now archived and is closed to further replies.