Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • Advised Way to Close Tabs


    Robosoldier2

    Recommended Posts

    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

    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

    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

    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;
    }

     

    Edited by camalCase
    Link to comment
    Share on other sites

    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

    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 account

    Sign in

    Already have an account? Sign in here.

    Sign In Now
    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.