yfoo Posted December 12, 2017 Share Posted December 12, 2017 The client is able to highlight the bounds of interaction for items in the inventory. What class/methods would I use to obtain these bounds? Quote Link to comment Share on other sites More sharing options...
Muffins Posted December 12, 2017 Share Posted December 12, 2017 getModel().getBoundingBox() i believe it is probably wrong tho Quote Link to comment Share on other sites More sharing options...
Apaec Posted December 12, 2017 Share Posted December 12, 2017 Yeah, not sure! I didn't look too far into the API, I may have missed something... but from what I can see, the only way to do this is via the MouseDestination associated with the slot. You can get the rectangle like this: Rectangle rectangle = getInventory().getMouseDestination(getInventory().getSlot(item)).getBoundingBox(); Gl! Apa 2 Quote Link to comment Share on other sites More sharing options...
yfoo Posted December 12, 2017 Author Share Posted December 12, 2017 (edited) Thanks guys, I ended up using the mouse position display and hardcoding it. I'll remember this. Edited December 12, 2017 by PayPalMeRSGP Quote Link to comment Share on other sites More sharing options...
Team Cape Posted December 13, 2017 Share Posted December 13, 2017 15 hours ago, PayPalMeRSGP said: Thanks guys, I ended up using the mouse position display and hardcoding it. I'll remember this. Are you clicking on the same pixel every time, or within a set bounds? Quote Link to comment Share on other sites More sharing options...
Apaec Posted December 13, 2017 Share Posted December 13, 2017 18 hours ago, PayPalMeRSGP said: Thanks guys, I ended up using the mouse position display and hardcoding it. I'll remember this. Hmm? What exactly are you trying to achieve by the way? Hopefully I/we can help! Apa Quote Link to comment Share on other sites More sharing options...
yfoo Posted December 14, 2017 Author Share Posted December 14, 2017 (edited) A random mouse move within the bounds of the the high alch icon. My solution was to hardcode the 2 points on opposite corners of the icon (bounds) as at the time I did not know the method to obtain them. private static final Point LOWER_BOTTOM_LEFT_BOUND = new Point(709,336); private static final Point UPPER_TOP_RIGHT_BOUND = new Point(720,321); private boolean randomMouseMove(){ this.randomMouseMoveCountdown--; if(this.randomMouseMoveCountdown <= 0){ this.randomMouseMoveCountdown = ThreadLocalRandom.current().nextInt(750, 1001); int randX = ThreadLocalRandom.current().nextInt(LOWER_BOTTOM_LEFT_BOUND.x, UPPER_TOP_RIGHT_BOUND.x); int randY = ThreadLocalRandom.current().nextInt(LOWER_BOTTOM_LEFT_BOUND.y, UPPER_TOP_RIGHT_BOUND.y); getMouse().move(randX, randY); return true; } return false; } 18 hours ago, Team Cape said: Are you clicking on the same pixel every time, or within a set bounds? Within a set bounds. Edited December 14, 2017 by PayPalMeRSGP Quote Link to comment Share on other sites More sharing options...