jazberry 1 Share 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? Link to comment Share on other sites More sharing options...
Manly 878 Share Posted August 4, 2017 IIRC, some methods relating to zoom in the api are broken. Link to comment Share on other sites More sharing options...
Nuclear Nezz 1949 Share 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. Link to comment Share on other sites More sharing options...
jazberry 1 Author Share 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. Link to comment Share on other sites More sharing options...
Manly 878 Share 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 Link to comment Share on other sites More sharing options...
jazberry 1 Author Share Posted August 5, 2017 (edited) 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"); } Edited August 6, 2017 by jazberry century 1 Link to comment Share on other sites More sharing options...
century 26 Share 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. 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