Jump to content

Check if the menu is of item...


Recommended Posts

Posted
	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 :(

Posted

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.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...