Jump to content

Painting the Inventory


TheScrub

Recommended Posts

public static void drawInventoryItem(final Graphics2D g, final int id) {
    final Item[] items = client.getInventory().getItems();
    for (int i = 0; i < items.length; i++) {
         if (items[i] != null && items[i].getId() == id) {
             final Rectangle r = client.getInventory().getDestinationForSlot(i);
             g.drawRect(r.x, r.y, r.width, r.height);
         }
    }
}

Looks good. This is what I like to use. happy.png

 

Of course, you can always change it to fit your needs/preferences.

Edited by Celestial
Link to comment
Share on other sites

public static void drawInventoryItem(final Graphics2D g, final int id) {
    final Item[] items = client.getInventory().getItems();
    for (int i = 0; i < items.length; i++) {
         if (items[i] != null && items[i].getId() == id) {
             final Rectangle r = client.getInventory().getDestinationForSlot(i);
             g.drawRect(r.x, r.y, r.width, r.height);
         }
    }
}

Looks good. This is what I like to use. happy.png

 

Of course, you can always change it to fit your needs/preferences.

 

 

not really what people are after your's draws a single item and requires an ID mines not even done correctly due to osbot's inventory api i should write my own inventory api

 

what i wrote is more for drawing inventory so people can get id's for scripts such as my trader

Link to comment
Share on other sites

not really what people are after your's draws a single item and requires an ID mines not even done correctly due to osbot's inventory api i should write my own inventory api

 

what i wrote is more for drawing inventory so people can get id's for scripts such as my trader

Like I mentioned previously, you can easily change my code to fit your needs...

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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