usedcomdom Posted July 2, 2018 Share Posted July 2, 2018 I have been playing around with equipping gear in the gear UI but I am not able to use the inventory functions that are built in, the reason for this is when I call for example getInventory().getItem(id).interact(action); The script closes the UI, opens the inventory page and equips it there. How Can I equip the gear from this page without this odd interaction? Another reason I find this strange is that when in the bank, the inventory functions still work fine but it only seems to be in this UI. Quote Link to comment Share on other sites More sharing options...
FrostBug Posted July 2, 2018 Share Posted July 2, 2018 (edited) Well, I don't think you can do it with the built in API since it will close any open widget except for the bank one (which I believe is a hardcoded exception). Why do you want to do this anyway? It's a little ugly, but you could use this as a possible workaround: int slot = getInventory().getSlot(filter); MouseDestination dest = new AreaDestination(getBot(), getInventory().getMouseDestination(slot).getArea()); getMouse().click(dest); The extra MouseDestination wrap is because I believe the widget check is actually located in the InventoryMouseDestination class; at least it used to be, might've been changed since. EDIT: If it has been changed, you can remove the AreaDestination wrap. Edited July 2, 2018 by FrostBug Quote Link to comment Share on other sites More sharing options...
usedcomdom Posted July 2, 2018 Author Share Posted July 2, 2018 15 minutes ago, FrostBug said: Well, I don't think you can do it with the built in API since it will close any open widget except for the bank one (which I believe is a hardcoded exception). Why do you want to do this anyway? It's a little ugly, but you could use this as a possible workaround: int slot = getInventory().getSlot(filter); MouseDestination dest = new AreaDestination(getBot(), getInventory().getMouseDestination(slot).getArea()); getMouse().click(dest); The extra MouseDestination wrap is because I believe the widget check is actually located in the InventoryMouseDestination class; at least it used to be, might've been changed since. EDIT: If it has been changed, you can remove the AreaDestination wrap. I've given that a go both with and without the AreaDestination wrap, but the destination in both scenarios has IsVisible() set to false so the mouse click event ignores it, but it works when outside the Gear window Quote Link to comment Share on other sites More sharing options...
FrostBug Posted July 2, 2018 Share Posted July 2, 2018 5 minutes ago, usedcomdom said: I've given that a go both with and without the AreaDestination wrap, but the destination in both scenarios has IsVisible() set to false so the mouse click event ignores it, but it works when outside the Gear window Is the slot -1 or wot? Quote Link to comment Share on other sites More sharing options...
usedcomdom Posted July 2, 2018 Author Share Posted July 2, 2018 2 minutes ago, FrostBug said: Is the slot -1 or wot? No, its a valid slot, I even hard coded it to make sure, a valid area is returned as well that encompasses the item's hitbox but the IsVisible() function return false when in the Gear. It's confusing. Quote Link to comment Share on other sites More sharing options...
FrostBug Posted July 2, 2018 Share Posted July 2, 2018 1 minute ago, usedcomdom said: No, its a valid slot, I even hard coded it to make sure, a valid area is returned as well that encompasses the item's hitbox but the IsVisible() function return false when in the Gear. It's confusing. It won't do that if the area is on the screen with AreaDestination; this ignores widgets and whatnot Maybe try MouseDestination dest = new RectangleDestination(getBot(), InventoryMouseDestination.getSlot(slot)); Quote Link to comment Share on other sites More sharing options...
usedcomdom Posted July 2, 2018 Author Share Posted July 2, 2018 4 minutes ago, FrostBug said: It won't do that if the area is on the screen with AreaDestination; this ignores widgets and whatnot Maybe try MouseDestination dest = new RectangleDestination(getBot(), InventoryMouseDestination.getSlot(slot)); Ahh It works now with a slight tweet MouseDestination dest = new RectangleDestination(getBot(), getInventory().getMouseDestination(slot).getBoundingBox()); getMouse().click(dest); Thank you for your help Quote Link to comment Share on other sites More sharing options...