Jump 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 increase/decrease attack radius?

Featured Replies

I'm wondering how I would be able to increase the range osbot scans for NPC's to attack.

I've looked through the API and couldn't find anything related to this but I've seen other combat scripts offering this so I'm wondering how they did it.

  • Author
1 minute ago, Malcolm said:

When you create your NPC to attack you can use a filter and filter it by an area

Thanks, I'll try to figure that out

8 hours ago, sinclair666 said:

Thanks, I'll try to figure that out

Code snippet to help ya out:

//Some variables to be used in calculating the npc.
Area areaAroundPlayer = myPlayer().getArea(10);
String npcName = "NPCName";

//Creating a filter for the npc.
Filter<NPC> npcFilter = new Filter<NPC>() {
    @Override
    public boolean match(NPC npc) {
        return areaAroundPlayer.contains(npc) && npc.getName().equals(npcName) && npc.isAttackable() && getMap().canReach(npc);
    }
};

//You can also use lambda expressions to create the filter which would look like this
Filter<NPC> npcFilter = npc -> areaAroundPlayer.contains(npc) && npc.getName().equals(npcName) && npc.isAttackable() && getMap().canReach(npc);

//Using the filter to obtain an npc.
NPC npc = getNpcs().closest(npcFilter);

 

  • Author
2 hours ago, BravoTaco said:

Code snippet to help ya out:


//Some variables to be used in calculating the npc.
Area areaAroundPlayer = myPlayer().getArea(10);
String npcName = "NPCName";

//Creating a filter for the npc.
Filter<NPC> npcFilter = new Filter<NPC>() {
    @Override
    public boolean match(NPC npc) {
        return areaAroundPlayer.contains(npc) && npc.getName().equals(npcName) && npc.isAttackable() && getMap().canReach(npc);
    }
};

//You can also use lambda expressions to create the filter which would look like this
Filter<NPC> npcFilter = npc -> areaAroundPlayer.contains(npc) && npc.getName().equals(npcName) && npc.isAttackable() && getMap().canReach(npc);

//Using the filter to obtain an npc.
NPC npc = getNpcs().closest(npcFilter);

 

Thanks!

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

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.