anderiel Posted June 2, 2016 Share Posted June 2, 2016 I want to drag around items in inventory, to arrange them for easier clicking. But i cant figure out how to actually drag them to change the place of one item. Inventory does not have any calls for that (or at least i did not find any) and i also tried this: execute(new ContinualClickMouseEvent(inventory.getMouseDestination(from),new Condition(){ @Override public boolean evaluate() { return InventorySlotDestination.getSlot(to).contains(mouse.getPosition()); } })); execute(new MoveMouseEvent(inventory.getMouseDestination(to),true)); but all that does is it clicks the item i want to drag and stays there until i force quit the script. Quote Link to comment Share on other sites More sharing options...
Incus Valley Posted June 2, 2016 Share Posted June 2, 2016 (edited) This is what I use to swap items in inventory spaces. public boolean swapItems(int slot1, int slot2) throws InterruptedException { if (getInventory().isItemSelected()) { getInventory().deselectItem(); } return getMouse().continualClick(getInventory().getMouseDestination(slot1), new Condition() { @Override public boolean evaluate() { getMouse().move(getInventory().getMouseDestination(slot2), true); return getInventory().getMouseDestination(slot2).getBoundingBox().contains(getMouse().getPosition()); } }); } Kinda messy, but it works. Edited June 2, 2016 by Incus Valley Quote Link to comment Share on other sites More sharing options...
anderiel Posted June 3, 2016 Author Share Posted June 3, 2016 It does work, thanks i do wonder if there is a cleaner solution though. Quote Link to comment Share on other sites More sharing options...