Skip to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How to paint NPC?

Featured Replies

How do I paint a NPC on the minimap and give it an other color on the screen?

Well first you have to make a method that will calculate a Entity's position to a Point of the minimap. Then you can just draw this point in the onPaint method.

Edited by KEVzilla

How do I paint a NPC on the minimap and give it an other color on the screen?

@Override
public void onPaint(Graphics2D g){
        
    g.setColor(Color.RED);
    g.fill(new MiniMapTileDestination(getBot(), npc.getPosition()).getBoundingBox().getBounds2D());
}

Edited by Explv

  • Author
@Override
public void onPaint(Graphics2D g){
        
    g.setColor(Color.RED);
    MiniMapTileDestination npcTileDest = new MiniMapTileDestination(getBot(), npc.getPosition());
    g.fill(npcTileDest.getBoundingBox().getBounds2D());
}

Can I also use this method to paint the NPC it self on the screen instead of on the minimap?

Can I also use this method to paint the NPC it self on the screen instead of on the minimap?

 

For that you would do something like:

g.fill(npc.getModel().getBoundingBox(npc.getGridX(), npc.getGridY(), npc.getZ()));

Note: use g.fill to create a filled in rectangle, or g.draw if you just want the outline.

Edited by Explv

It's been a while since I've played with these methods, but if I remember correctly there is a drawModel() method.

 

When you click the [x] NPCs debug option, it draws an outline around all NPC models in the game. I reversed OSBot and inserted code to see how it was doing this; there is an internal method called something like:

 

GraphicUtilities.drawModel(obj, color, x, y)

 

I am just going off memory here, but it was definitely the GraphicUtilities class.

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.