AliasBots 12 Share Posted March 6, 2019 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 More sharing options...
depwession 26 Share Posted March 6, 2019 (edited) 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 March 6, 2019 by depwession Link to comment Share on other sites More sharing options...
AliasBots 12 Author Share Posted March 6, 2019 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 More sharing options...
Koschei 147 Share Posted March 7, 2019 Can also use this method, based off slots btw. https://dreambot.org/javadocs/org/dreambot/api/methods/grandexchange/GrandExchange.html#isReadyToCollect-- Link to comment Share on other sites More sharing options...
AliasBots 12 Author Share Posted March 29, 2019 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. Milasoft 1 Link to comment Share on other sites More sharing options...
bebeli555 8 Share Posted November 14, 2020 (edited) . Edited September 15, 2021 by bebeli555 Link to comment Share on other sites More sharing options...
una_maquina 27 Share Posted November 22, 2020 (edited) while(!GrandExchange.isReadyToCollect()){ sleep... } GrandExchange.collect(); This should solve your problem EDIT: Oh shaize, didn't notice it's a 2019 post Edited November 22, 2020 by una_maquina 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