February 24, 201510 yr public static Rectangle getItemRectangleInBank(int slot) { Rectangle rect = getItemRectangle(slot); rect.width += 4; return rect; } public static Rectangle getItemRectangle(int slot) { int freeSpaceX = 11; int freeSpaceY = 5; int width = 31; int height = 31; int x = 563; int y = 213; int newX = x + ((slot % 4) * width) + ((slot % 4) * freeSpaceX); int newY = y + ((slot / 4) * height) + ((slot / 4) * freeSpaceY); return new Rectangle(newX, newY, width, height); } why
February 24, 201510 yr To get the rectangle lol? I don't understand the purpose of what this does. please explain a case where this would be used
February 24, 201510 yr Ok let me help you out there buddy. Like they said thats a bit hard core. I'm not really sure what you trying to do here. To get the rec of the item use abstract mouse destination class. For bank use BankSlotDestination and for inventory use inventoryslotdestination. Osb already did all the hard coding for us. To get slot of item in bank or inventory use the itemcontainer abstract class Use the menu class, it has great methods like select action.
February 24, 201510 yr Author You can use this method for your own interacting method. For example you want tp interact with the item on slot 0 but the menu for this item is already open you can check if it's really the menu of this item and interact with it instead of close and reopen it.
Create an account or sign in to comment