KankerHenk 0 Share Posted July 30, 2020 Hey, I'm having some trouble where a script will sometimes have an item selected after dropping an inventory, and then fails to perform its next action. The solution is to click somewhere to de-select the item. The only way i've found that seems to work is to move the mouse to a random position and click(). I was wondering if there is a more elegant way of canceling a selection. The way i currently do it is as follows: if(mc.getInventory().getSelectedItemIndex() != -1){ Point p = new Point(Calculations.random(520, 549), Calculations.random(208, 338)); mc.getMouse().move(p); sleep(randomWait(1400)); mc.getMouse().click(); sleep(randomWait(1800)); } (mc here is the method context or 'this' of the script) Thanks! Link to comment Share on other sites More sharing options...
SubCZ 255 Share Posted July 30, 2020 (edited) The Inventory class has a built in method for this: mc.getInventory().deselect() Note that Inventory also has a method to check if an item is selected: mc.getInventory().isItemSelected() Edited July 30, 2020 by SubCZ KankerHenk 1 Link to comment Share on other sites More sharing options...
KankerHenk 0 Author Share Posted August 3, 2020 Thanks so much Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now