FriedNuts 2 Posted December 2, 2021 GroundItem item = GroundItems.closest(#); if (item !=null && !Inventory.isFull()){ item.interact(); sleep(Calculations.random(500,600)); } I have the following code above, when I have a stack of one item dropped on the floor it will LEFT click the stack for a good amount then try to right click one of the items that is lower in the stack of items. How can i make it such that it does not do that? Thought process would be change the code to click on the tile but what if a random item shows up on the stack?
Neffarion 486 Posted December 2, 2021 6 minutes ago, FriedNuts said: GroundItem item = GroundItems.closest(#); if (item !=null && !Inventory.isFull()){ item.interact(); sleep(Calculations.random(500,600)); } I have the following code above, when I have a stack of one item dropped on the floor it will LEFT click the stack for a good amount then try to right click one of the items that is lower in the stack of items. How can i make it such that it does not do that? Thought process would be change the code to click on the tile but what if a random item shows up on the stack? Make sure you add the action string in the interact method that is shown on the menu when you right-click the item on the floor.
FriedNuts 2 Author Posted December 2, 2021 2 minutes ago, Neffarion said: Make sure you add the action string in the interact method that is shown on the menu when you right-click the item on the floor. Thing is i don't want to right click the item on the floor, i just want to click on it repeatedly. My goal is to do as follows: Collect item Drop till 28 items on floor. Click on stack, wouldn't need to right click.
Axolotl 31 Posted December 2, 2021 Just gotta make your own interact method: public boolean interact(GroundItem item) { if(item != null && !Inventory.isFull()) { sleepUntil(() -> Mouse.move(item), Calculations.random(888, 1666)); return Mouse.click(item); } return false; } This is just the basics, I have a more advanced version I use but I'd rather not share it. You can add failsafes and other checks to ensure it does click the item by filtering: Mouse.getEntitiesOnCursor() and ensuring it is the top object / the mouse is actually there
FriedNuts 2 Author Posted December 2, 2021 39 minutes ago, Axolotl said: Just gotta make your own interact method: public boolean interact(GroundItem item) { if(item != null && !Inventory.isFull()) { sleepUntil(() -> Mouse.move(item), Calculations.random(888, 1666)); return Mouse.click(item); } return false; } This is just the basics, I have a more advanced version I use but I'd rather not share it. You can add failsafes and other checks to ensure it does click the item by filtering: Mouse.getEntitiesOnCursor() and ensuring it is the top object / the mouse is actually there Thank you, this works perfectly for what i need.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.