geoffrey456 Posted May 1, 2017 Author Share Posted May 1, 2017 10 minutes ago, Explv said: No idea why you would want to do this (assumes shift drop enabled): private void funkyDropAll(final String itemName) throws InterruptedException { getKeyboard().pressKey(VK_SHIFT); for (int i : new int[]{0, 4, 1, 5, 2, 6, 3, 7, 8, 12, 9, 13, 10, 14, 11, 15, 16, 20, 17, 21, 18, 22, 19, 23, 24, 25, 26, 27}) { Item item = getInventory().getItemInSlot(i); if (item != null && item.getName().equals(itemName)) { getInventory().interact(i); MethodProvider.sleep(random(20, 25)); } } getKeyboard().releaseKey(VK_SHIFT); } Looking into is to implemented this rip 2k17 Quote Link to comment Share on other sites More sharing options...
The Undefeated Posted May 1, 2017 Share Posted May 1, 2017 (edited) 27 minutes ago, Explv said: No idea why you would want to do this (assumes shift drop enabled): private void funkyDropAll(final String itemName) throws InterruptedException { getKeyboard().pressKey(VK_SHIFT); for (int i : new int[]{0, 4, 1, 5, 2, 6, 3, 7, 8, 12, 9, 13, 10, 14, 11, 15, 16, 20, 17, 21, 18, 22, 19, 23, 24, 25, 26, 27}) { Item item = getInventory().getItemInSlot(i); if (item != null && item.getName().equals(itemName)) { getInventory().interact(i); MethodProvider.sleep(random(20, 25)); } } getKeyboard().releaseKey(VK_SHIFT); } Could be made cleaner: private void funkyDropAll(final String itemName) throws InterruptedException { getKeyboard().pressKey(VK_SHIFT); for (int i = 0; i < 28; i++) { Item item = getInventory().getItemInSlot(i); if (item != null && item.getName().equals(itemName)) { getInventory().interact(i); MethodProvider.sleep(random(20, 25)); } } getKeyboard().releaseKey(VK_SHIFT); } Edited May 1, 2017 by The Undefeated Quote Link to comment Share on other sites More sharing options...
Explv Posted May 1, 2017 Share Posted May 1, 2017 2 minutes ago, The Undefeated said: Could be made cleaner: private void funkyDropAll(final String itemName) throws InterruptedException { getKeyboard().pressKey(VK_SHIFT); for (int i = 0; i < 28; i++) { Item item = getInventory().getItemInSlot(i); if (item != null && item.getName().equals(itemName)) { getInventory().interact(i); MethodProvider.sleep(random(20, 25)); } } getKeyboard().releaseKey(VK_SHIFT); } That would just drop normally? The only reason I specified the array of indices was to drop in the order OP wanted. 3 Quote Link to comment Share on other sites More sharing options...
Saiyan Posted May 1, 2017 Share Posted May 1, 2017 16 minutes ago, The Undefeated said: Could be made cleaner: private void funkyDropAll(final String itemName) throws InterruptedException { getKeyboard().pressKey(VK_SHIFT); for (int i = 0; i < 28; i++) { Item item = getInventory().getItemInSlot(i); if (item != null && item.getName().equals(itemName)) { getInventory().interact(i); MethodProvider.sleep(random(20, 25)); } } getKeyboard().releaseKey(VK_SHIFT); } Wouldn't that just drop in the standard manner? Quote Link to comment Share on other sites More sharing options...
The Undefeated Posted May 1, 2017 Share Posted May 1, 2017 29 minutes ago, Explv said: That would just drop normally? The only reason I specified the array of indices was to drop in the order OP wanted. Wow, didn't even notice that. I thought you wanted him to add a check himself. Quote Link to comment Share on other sites More sharing options...