April 4, 201510 yr So I want my mouse to move to a entity, right click on it and then move to an option from the "Choose option" menu but not click on it. I already have this for example: Entity door = objects.closest("Door"); EntityDestination mouseDoor = new EntityDestination(getBot(),door); getMouse().click(mouseChest, true); now the mouse just moves to the door and right clicks on it. But what should i add to make it even move to the "Open" action but not click on it yet?
April 4, 201510 yr Umm maybe something along the lines of this: (Not sure if it works but the logic is there and could be tweaked) void hovenEntityOption(Entity entity, String option){ if(menu.isOpen() && menuContains(option)){ Rectangle optionBox = menu.getOptionRectangle(menuIndex(option)); if(optionBox != null){ if(optionBox.contains(mouse.getPosition())){ //idling }else{ int x,y; do { x = (int) (optionBox.getX() + optionBox.getWidth() * Math.random()); y = (int) (optionBox.getY() + optionBox.getHeight() * Math.random()); } while(!optionBox.contains(x,y)) ; mouse.move(x,y); } } }else{ if(menu.isOpen() && !menuContains(option)){ menu.selectAction("Cancel"); }else { if (entity.hover()) { mouse.click(false); } } } }
Create an account or sign in to comment