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
  • Try asking for help in the chatbox
  • Check if GE "Collect" widget is visible. Collecting early.


    AliasBots
     Share

    Recommended Posts

    Hey all,

    Lately, I've been trying to get my script to collect gold from GE whenever it's ready. If the button is there, I want to click it.

    The problem is, using

    getGrandExchange.collect(); 

    seems to only collect if an order is completely finished.

     

    And looking for the widget leads to it clicking even when the button isn't visible.

    WidgetChild collectButton = getWidgets().getWidgetChild(465, 6, 0);
    if(getGrandExchange().isOpen() && collectButton.isVisible() && collectButton != null){
        collectButton.interact("Collect to inventory");
        log("Item collected..");
    }

    This if statement always ends up as true.

    How can I check if things are ready to collect in the GE before the entire order has finished?

    Thanks for any help.

    Link to comment
    Share on other sites

    The last time I had problems with widgets it was because I didn't put the null check before the isVisible, so you could try that 😛

    besides that Idk how to work around it but gl

    Edited by depwession
    Link to comment
    Share on other sites

    21 minutes ago, depwession said:

    The last time I had problems with widgets it was because I didn't put the null check before the isVisible, so you could try that 😛

    besides that Idk how to work around it but gl

    Thank you, I'll try this.

    Link to comment
    Share on other sites

    • 4 weeks later...

    As a followup, I think I finally figured it out.

    It looks like widget.getTextureID is -1 when not ready, 812 when ready, and 813 when hovered over.

    Either debug tool updates slowly, or it doesn't read as -1 again after collecting unless the exchange is closed and opened.

    Test around a little for bugs but this should help anyone wondering the same thing that I was.

    Link to comment
    Share on other sites

    • 1 year later...

    while(!GrandExchange.isReadyToCollect()){

    sleep...

    }

    GrandExchange.collect();

     

    This should solve your problem

     

    EDIT:

    Oh shaize, didn't notice it's a 2019 post

    Edited by una_maquina
    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
     Share

    ×
    ×
    • 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.