Guiness1 0 Share Posted April 26, 2020 Hi guys, Im just learning to script. I want to click items in my inventory. How do I do this please? Many Thanks Conor Link to comment Share on other sites More sharing options...
Koschei 147 Share Posted April 26, 2020 https://dreambot.org/javadocs/org/dreambot/api/methods/container/impl/Inventory.html#interact-java.lang.String-java.lang.String- Example: if (getInventory().interact("Lobster","Eat")){ sleep(1200); } Link to comment Share on other sites More sharing options...
Guiness1 0 Author Share Posted April 26, 2020 Thanks Koschie, Im looking to click on 27 items in my invent. How would I go about do that? Thanks! Link to comment Share on other sites More sharing options...
Koschei 147 Share Posted April 26, 2020 7 minutes ago, Guiness1 said: Thanks Koschie, Im looking to click on 27 items in my invent. How would I go about do that? Thanks! Can do something like this. for (Item item : getInventory().all(i-> i != null && i.getName().equals("Trout"))) { if (item.interact("Drop")) sleep(200,300); } Link to comment Share on other sites More sharing options...
Guiness1 0 Author Share Posted April 26, 2020 Adjusted that to drop what I need. It seems to do the clicking but not on my actual invent. It doesn't swap to my invent before hand. Just clicks on my magic tab is there a way to make sure it's got my invent open? thanks for all the help Link to comment Share on other sites More sharing options...
Zawy 936 Share Posted April 26, 2020 1 hour ago, Guiness1 said: Adjusted that to drop what I need. It seems to do the clicking but not on my actual invent. It doesn't swap to my invent before hand. Just clicks on my magic tab is there a way to make sure it's got my invent open? thanks for all the help getTabs().isOpen && getTabs().open(Tab.INVENTORY) Go look in the docs, its all there Link to comment Share on other sites More sharing options...
Soldtodie 76 Share Posted April 26, 2020 if(getTabs().isOpen || getTabs().open(Tab.INVENTORY)) { ... } Link to comment Share on other sites More sharing options...
Guiness1 0 Author Share Posted April 27, 2020 Thanks both Link to comment Share on other sites More sharing options...
Pseudo 179 Share Posted April 27, 2020 Have a good read of the api if you're serious about learning. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.