justinwagoner 0 Share Posted April 1, 2023 The problem I'm looking to solve is how to make sure that when dropping 27/28 items in an inventory is a fast manner, how to make sure all 27 items are dropped using shift-click instead of right-click. It appears very botlike when randomly 2 of the items are dropped using right-click, especially when shift is already held. I was originally trying to use Inventory#dropAll but it was a little slow and would occasionally do the right-click drop. Here is the code I've got now public void dropItems(int[] dropOrder) { Keyboard.pressShift(); for(int i : dropOrder) { Item item = Inventory.getItemInSlot(i); if(item != null && !shouldKeep(item.getName())) { item.interact("Drop"); } } Keyboard.releaseShift(); } Any ideas on how to force the drop to be a left click? I noticed that GameObjects have the option to Force Left Click but can't find anything like that for items. Link to comment Share on other sites More sharing options...
justinwagoner 0 Author Share Posted April 1, 2023 I've found that there is a ForceNoShift that can be enabled so that all inventory items are right-click dropped. I'm looking for the opposite of this basically Link to comment Share on other sites More sharing options...
Presumptuous 24 Share Posted April 2, 2023 Mouse.getMouseSettings().setRightClick(false); You could always enable it after dropping all items if you need it for anything else. Link to comment Share on other sites More sharing options...
justinwagoner 0 Author Share Posted April 3, 2023 21 hours ago, Presumptuous said: Mouse.getMouseSettings().setRightClick(false); You could always enable it after dropping all items if you need it for anything else. Thanks for this. Unfortunately looks like interact doesn't request from mouse settings before determining left or right click. Think I'm just going to have to write my own method from scratch to avoid using Item#interact to drop the item. Link to comment Share on other sites More sharing options...
hashbang 8 Share Posted April 3, 2023 You could just `Mouse.click()` on every inventory slot? public void dropItems(int[] dropOrder) { Keyboard.pressShift(); for (int i : dropOrder) { Item item = Inventory.getItemInSlot(i); if (item != null && !shouldKeep(item.getName())) { Mouse.click(Inventory.slotBounds(i)); } } Keyboard.releaseShift(); } Link to comment Share on other sites More sharing options...
justinwagoner 0 Author Share Posted April 3, 2023 12 hours ago, hashbang said: You could just `Mouse.click()` on every inventory slot? public void dropItems(int[] dropOrder) { Keyboard.pressShift(); for (int i : dropOrder) { Item item = Inventory.getItemInSlot(i); if (item != null && !shouldKeep(item.getName())) { Mouse.click(Inventory.slotBounds(i)); } } Keyboard.releaseShift(); } Thank you. This is what I needed. If anyone else needs it, this is the solution. Link to comment Share on other sites More sharing options...
KeesOG 0 Share Posted April 9, 2023 if(Inventory.isFull()) { List<Item> inventory = methodsClass.getPlayerInventory(); Keyboard.pressShift(); for(int i = 0; i < inventory.size(); i++) { if(inventory.get(i).getName().equals("Willow logs")) { inventory.get(i).interact("Drop"); } } Keyboard.releaseShift(); } This seems to work for me for shift dropping items. I had to enable shift-click dropping in runescape settings. any way of enabling that setting with code? Link to comment Share on other sites More sharing options...
hashbang 8 Share Posted April 9, 2023 1 hour ago, KeesOG said: This seems to work for me for shift dropping items. I had to enable shift-click dropping in runescape settings. any way of enabling that setting with code? Try this. You may not even need to check if it's already enabled, the Toggle function may check that already and just no-op if it's already enabled. if (!ClientSettings.isShiftClickDroppingEnabled()) { ClientSettings.toggleShiftClickDropping(true); } KeesOG 1 Link to comment Share on other sites More sharing options...
KeesOG 0 Share Posted April 9, 2023 Thanks bro really helped! 5 hours ago, hashbang said: Try this. You may not even need to check if it's already enabled, the Toggle function may check that already and just no-op if it's already enabled. if (!ClientSettings.isShiftClickDroppingEnabled()) { ClientSettings.toggleShiftClickDropping(true); } 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