public static boolean dropGems() { // this should work fine... if (totalTypes == 0) { return false; } boolean dropped = false; // wow harder to drop stuff then i thought. while (Inventory.contains(gemDropList)) { for (int i = 0; i < gemIds.length; i++) { if (gemsToDrop.get(gemIds[i])) { for (int j = 0; j < 28; j++) { Item current = Inventory.getItemAt(j); if (current != null) { if (current.getId() == gemIds[i]) { current.getWidgetChild().interact("Drop"); Task.sleep(200, 350); dropped = true; } } } } } } if (dropped) return true; return false; }
/** * Equips an item if it is in the inventory * * @param itemIds the ids of the item(s) that need(s) to be equipped * @return <tt>true</tt> if an item was successfully equipped otherwise <tt>false</tt> */ public static boolean equip(final int... itemIds) { final Item item = Inventory.getItem(itemIds); if (item != null) { int index = -1; for (final int itemId : itemIds) { if ((index = Inventory.indexOf(itemId)) != -1) { break; } } final WidgetChild item_child = item.getWidgetChild(); for (String action : item_child.getActions()) { if (action == null) { continue; } if (action.contains("Equip") || action.contains("Wear") || action.contains("Wield")) { item_child.interact(action); } } for (int i = 0; i < 100; i++) { if (!item.equals(Inventory.getItemAt(index))) { return true; } Task.sleep(10); } } return false; }