lolhelllol Posted September 27, 2017 Share Posted September 27, 2017 (edited) Hey! I am trying to implement shift-clicking on Rune Essence Pouches in order to empty them in one click. This is similar to this shift click drop feature. Is it possible to implement this with current API, as I have not found much hope around the interact function within the ItemContainer class. Cheers, D UPDATE: SOLUTION for emptying pouches: After some discussion on trials I came up with the following: Quote getKeyboard().pressKey(16); getInventory().getItem("Large pouch").interact("Empty"); getKeyboard().releaseKey(16); Edited September 28, 2017 by lolhelllol Quote Link to comment Share on other sites More sharing options...
Juggles Posted September 27, 2017 Share Posted September 27, 2017 (edited) getInventory.drop("item"); ..... That's all you need. Have it enabled on your acc and it will use it..... Pls look at API before posting next time.. .. . . .... . ... .... Edited September 27, 2017 by Juggles 2 Quote Link to comment Share on other sites More sharing options...
Muffins Posted September 27, 2017 Share Posted September 27, 2017 35 minutes ago, Juggles said: getInventory.drop("item"); ..... That's all you need. Have it enabled on your acc and it will use it..... Pls look at API before posting next time.. .. . . .... . ... .... jojo plz u cant expect people to search things and do research for themselves on osbot ;( 1 Quote Link to comment Share on other sites More sharing options...
mr magoo Posted September 27, 2017 Share Posted September 27, 2017 (edited) You could get the keyboard and mouse instance and send a shift and left click I guess. getKeyboard().pressKey(*KEYCODE FOR SHIFT*); getMouse().click(false); getKeyboard().releaseKey(*SAME KEYCODE FOR SHIFT*); This would presumably work. Edited September 27, 2017 by mr magoo Quote Link to comment Share on other sites More sharing options...
Viston Posted September 27, 2017 Share Posted September 27, 2017 14 hours ago, Juggles said: getInventory.drop("item"); ..... That's all you need. Have it enabled on your acc and it will use it..... Pls look at API before posting next time.. .. . . .... . 13 hours ago, Muffins said: jojo plz u cant expect people to search things and do research for themselves on osbot ;( Why you guys going at him like that, when he is asking for something completely different He wants to know if you can use Shift to empty the rune pouches with the API, which there isn't (AFAIK) You just need to make your own method, by using getKeyboard() and holding down shift key > Do action > release shift key Quote Link to comment Share on other sites More sharing options...
lolhelllol Posted September 28, 2017 Author Share Posted September 28, 2017 (edited) On 27/09/2017 at 5:10 PM, Juggles said: getInventory.drop("item"); ..... That's all you need. Have it enabled on your acc and it will use it..... Pls look at API before posting next time.. .. . . .... . 2 Thanks, I did try to look it up first. But, I wasn't sure how to interpret the descriptions in the API for drop. drop() does not work with emptying pouches Edited September 28, 2017 by lolhelllol Quote Link to comment Share on other sites More sharing options...
lolhelllol Posted September 28, 2017 Author Share Posted September 28, 2017 (edited) 10 hours ago, Viston said: Why you guys going at him like that, when he is asking for something completely different He wants to know if you can use Shift to empty the rune pouches with the API, which there isn't (AFAIK) You just need to make your own method, by using getKeyboard() and holding down shift key > Do action > release shift key Cheers for the understanding, I just tested out what Jnuggles posted and it turns out that .drop() doesn't work on pouches with the current API. Having to use a manual method Edited September 28, 2017 by lolhelllol Quote Link to comment Share on other sites More sharing options...
mr magoo Posted September 28, 2017 Share Posted September 28, 2017 (edited) So, when you shift click the rune pouch it automatically uses the empty option for the item? To make matters simpler I'm just going to assume the pouch is always in the first slot. It wouldn't be a bad idea to hard code it as players generally have a preferred location of the pouch. If you want to abstract it for it being in any position in the inventory, searching for it would be a good exercise to learn from. getMouse().move(getInventory().getMouseDestination(0)); getKeyboard().pressKey(KeyEvent.VK_SHIFT); getMouse().click(false); getKeyboard().releaseKey(KeyEvent.VK_SHIFT); This will shift click the first item (index 0) in your inventory. Edit: be sure to import the necessary KeyEvent package: import java.awt.event.KeyEvent; Edited September 28, 2017 by mr magoo Quote Link to comment Share on other sites More sharing options...
Viston Posted September 28, 2017 Share Posted September 28, 2017 (edited) 7 hours ago, mr magoo said: So, when you shift click the rune pouch it automatically uses the empty option for the item? To make matters simpler I'm just going to assume the pouch is always in the first slot. It wouldn't be a bad idea to hard code it as players generally have a preferred location of the pouch. If you want to abstract it for it being in any position in the inventory, searching for it would be a good exercise to learn from. getMouse().move(getInventory().getMouseDestination(0)); getKeyboard().pressKey(KeyEvent.VK_SHIFT); getMouse().click(false); getKeyboard().releaseKey(KeyEvent.VK_SHIFT); This will shift click the first item (index 0) in your inventory. Edit: be sure to import the necessary KeyEvent package: import java.awt.event.KeyEvent; No need to call getMouse.move() because he can just click the item in the inventory directly. getInventory().getItem("Essence Pouch").interact("Empty"); Since shift clicking will make the left click the option "Empty" it'll just left click it Edited September 28, 2017 by Viston 1 Quote Link to comment Share on other sites More sharing options...