jazberry 1 Posted August 4, 2017 Having a noob struggle trying to auto check/set zoom to default. First I tried... if( getClientSettings().getZoomValue() != 50) { getClientSettings().setDefaultZoom(); } But getZoomValue always returns 50 no matter what. So then I tried ... if( getClientSettings().getExactZoomValue() != 512) { getClientSettings().setDefaultZoom(); } This at least made it inside the IF when zoom wasn't default, but getClientSettings().setDefaultZoom(); doesn't seem to do anything. I even tried opening the options tab before calling it and still nothing. What am I doing wrong?
Nuclear Nezz 2107 Posted August 4, 2017 It's because our current zoom hook is broken, so the functionality of most of the zoom methods in the client are not going to work.
jazberry 1 Author Posted August 5, 2017 Ah ok. Thanks. I came up with this as a workaround. if( getClientSettings().getExactZoomValue() != 512) { if(!getTabs().isOpen(Tab.OPTIONS)) { getTabs().openWithMouse(Tab.OPTIONS); sleep(400,800); } getMouse().click(new Point (Calculations.random(562,581),Calculations.random(267,283)),true); sleep(400,800); getClient().getMenu().clickAction("Restore Default Zoom"); } If there's anything simpler, let me know.
Manly 879 Posted August 5, 2017 Ah ok. Thanks. I came up with this as a workaround. if( getClientSettings().getExactZoomValue() != 512) { if(!getTabs().isOpen(Tab.OPTIONS)) { getTabs().openWithMouse(Tab.OPTIONS); sleep(400,800); } getMouse().click(new Point (Calculations.random(562,581),Calculations.random(267,283)),true); sleep(400,800); getClient().getMenu().clickAction("Restore Default Zoom"); } If there's anything simpler, let me know. Use widgets for clicking the default zoom icon/button thingy.
jazberry 1 Author Posted August 5, 2017 Didn't even notice widgets. lol Ty! In case anyone ever searches. Here's what I ended up with. if(getClientSettings().getExactZoomValue() != 512) { if(!getTabs().isOpen(Tab.OPTIONS)) { getTabs().openWithMouse(Tab.OPTIONS); } getWidgets().getWidgetChild(261,4).interact("Restore Default Zoom"); }
century 26 Posted August 28, 2017 update: if( getClientSettings().getExactZoomValue() != 512) This condition is always returning false, as getExactZoomValue() always returns 512. Hopefully, the API can be fixed in the future.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.