Alakazizam Posted December 19, 2024 Share Posted December 19, 2024 (edited) I'm sure I'm just not doing something right. Pretty much just trying to drag a knife to the last inventory slot. public int onLoop() throws InterruptedException { if(inventory.contains("Knife")){ if(inventory.getSlot("Knife") == inventory.getSlot(27)){ log("We're good."); } else { MoveKnife(); } } return 602; } void MoveKnife() { boolean isInPosition = false; mouse.continualClick(inventory.getMouseDestination(inventory.getSlot("Knife")), new Condition() { @Override public boolean evaluate() { return isInPosition == true; } }); mouse.move(inventory.getMouseDestination(27)); isInPosition = true; } I get a compile error 'local variables referenced from an inner class must be final or effectively final' when building because I'm trying to change isInPosition after moving the mouse. But even if I remove that, all that is happening is the mouse is going click down on the knife and is not moving at all after that. Any help would be appreciated. Edited December 19, 2024 by Alakazizam Quote Link to comment Share on other sites More sharing options...
Chris Posted December 19, 2024 Share Posted December 19, 2024 1 hour ago, Alakazizam said: I'm sure I'm just not doing something right. Pretty much just trying to drag a knife to the last inventory slot. public int onLoop() throws InterruptedException { if(inventory.contains("Knife")){ if(inventory.getSlot("Knife") == inventory.getSlot(27)){ log("We're good."); } else { MoveKnife(); } } return 602; } void MoveKnife() { boolean isInPosition = false; mouse.continualClick(inventory.getMouseDestination(inventory.getSlot("Knife")), new Condition() { @Override public boolean evaluate() { return isInPosition == true; } }); mouse.move(inventory.getMouseDestination(27)); isInPosition = true; } I get a compile error 'local variables referenced from an inner class must be final or effectively final' when building because I'm trying to change isInPosition after moving the mouse. But even if I remove that, all that is happening is the mouse is going click down on the knife and is not moving at all after that. Any help would be appreciated. try InventorySlotDestination currItemDestination = new InventorySlotDestination(bot, currentSlot); InventorySlotDestination placementDestination = new InventorySlotDestination(bot, mapSlot); if (currentSlot != mapSlot) { if (bot.getMethods().getMouse().continualClick(currItemDestination, new Condition() { @Override public boolean evaluate() { return bot.getMethods().getMouse().move(placementDestination) && placementDestination.evaluate(); } })) { //sleep or do something after? } } This is an example from my code I use to sort my inventory using a map of items. this is how I get it to drag items around So mapSlot would be slot 27? 1 Quote Link to comment Share on other sites More sharing options...
Alakazizam Posted December 19, 2024 Author Share Posted December 19, 2024 Thanks! That got me squared away. 1 Quote Link to comment Share on other sites More sharing options...