AliasBots 13 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 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 Link to comment Share on other sites More sharing options...
AliasBots 13 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 13 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. Link to comment Share on other sites More sharing options...
bebeli555 8 Share Posted November 14, 2020 . Link to comment Share on other sites More sharing options...
una_maquina 35 Share Posted November 22, 2020 while(!GrandExchange.isReadyToCollect()){ sleep... } GrandExchange.collect(); This should solve your problem EDIT: Oh shaize, didn't notice it's a 2019 post Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.