You can also change the itemName to drop, to exception if you'd prefer that. Should be fairly easy to change.
public void dropAll(String itemName) throws InterruptedException {
Inventory inv = client.getInventory();
if (inv.contains(itemName)) {
for (Item item : inv.getItems()) {
if (item.getName().equalsIgnoreCase(itemName)) {
MouseDestination slotDestination = new RectangleDestination(
inv.getDestinationForSlot(inv
.getSlotForName(itemName)));
if (client
.moveMouseTo(slotDestination, false, false, false)) {
client.clickMouse(true);
int i = findOption("Drop");
if (i > 0) {
if (client.moveMouseTo(new RectangleDestination(
client.getMenuX(), client.getMenuY() + 5
+ (i * 15),
client.getMenuWidth() - 3, 6), false, true,
false)) {
sleep(random(150, 300));
}
}
}
}
}
}
}
public int findOption(String option) {
int i = 0;
Iterator<Option> it1 = client.getMenu().iterator();
while (it1.hasNext()) {
++i;
Option temp = it1.next();
if (temp.action.equalsIgnoreCase(option)) {
return i;
}
}
return 0;
}