Robosoldier2 2 Share Posted May 13, 2022 Hey all, I'm having a little trouble finding a method to close tabs (i.e. skills pane, backpack). I did search for "closing tab" on the forum and for predictable method names in the API docs, but to no avail. Looking through the methods for both the Tabs and Tab classes, I couldn't see any that applied. One thing I haven't tried is running openWithMouse whilst it is already open, to see if it will close it. Something I'll have to try later when at my development machine. I'm new to using the Dreambot API and Java in general, so not sure if javadocs is a common thing. Must say they're bloody great. Thanks for the work put in, and thanks in advance to anyone who can help me with this query. Robo Link to comment Share on other sites More sharing options...
camelCase 271 Share Posted May 13, 2022 10 minutes ago, Robosoldier2 said: I'm having a little trouble finding a method to close tabs (i.e. skills pane, backpack). I did search for "closing tab" on the forum and for predictable method names in the API docs, but to no avail. Looking through the methods for both the Tabs and Tab classes, I couldn't see any that applied. what do you mean close tabs? is that a modern layout thing? if so the answer is to use classic layout Link to comment Share on other sites More sharing options...
Robosoldier2 2 Author Share Posted May 13, 2022 4 minutes ago, camalCase said: what do you mean close tabs? is that a modern layout thing? if so the answer is to use classic layout Thanks Camal. Forgot about the differences, it's a modern thing yeah. Dreambot offers modern layout as an option in the client, and I like the look of it myself (I do partly play on the account in the midst of botting). Had hoped there might be a way to do it given the client support. I guess generating a click on the tab's location could work as an alternative to a built-in method. Either way, thanks for your help. One for me to think about. Link to comment Share on other sites More sharing options...
camelCase 271 Share Posted May 13, 2022 7 minutes ago, Robosoldier2 said: and I like the look of it myself imo you are a sick sick individual try something like this public boolean closeTab() { if () { // check if the tabs are not* open, idk what widget that would be return true; } WidgetChild tab = Tabs.getOpen().getWidgetChild(); if (tab != null && tab.isVisible() && tab.interact) { return true; // maybe check again if the tabs actually closed } return false; } Link to comment Share on other sites More sharing options...
Robosoldier2 2 Author Share Posted May 13, 2022 53 minutes ago, camalCase said: imo you are a sick sick individual try something like this public boolean closeTab() { if () { // check if the tabs are not* open, idk what widget that would be return true; } WidgetChild tab = Tabs.getOpen().getWidgetChild(); if (tab != null && tab.isVisible() && tab.interact) { return true; // maybe check again if the tabs actually closed } return false; } Haha, spoken like a true RuneScape purist. I've only just realised there is a resizable classic option. Being locked into the tiny box was what put me off and made me use modern. Sounds like a good way to have the "always-open" tabs with a much better view of the game. Will give it a whirl later. Thanks for the code. I haven't looked at the widget class, but I see what the code is aiming to do. Fingers crossed it gives a viable option for those peasants out there choosing to use modern! Link to comment Share on other sites More sharing options...
SubCZ 283 Share Posted May 13, 2022 Here's a one liner & what I'd do when speed matters (bossing etc) if(Tabs.getOpen() != null) Keyboard.typeSpecialKey(Tabs.getOpen().getKeyEvent()); Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.