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 open doors when NPC can't be reached?

Featured Replies

I'm writing an AIO fighter and I want my script to open doors if the closest attackable NPC is behind one (eg: Al-Kharid Warriors, some cunt closes a door in my face). Is there a better method for this than webwalking to the NPC's position?

target = npcs.closest(n -> n.getName().equals(targetName) && n.exists()
					&& n.getHealthPercent() > 0 && !myPlayer().isInteracting(n)
					&& !n.isUnderAttack() && n != null);
if (!map.canReach(target)) getWalking().webWalk(target.getPosition());
else {
	// do combat stuff
}

^^ that's sort of what I'm using but webWalk is heavy on resources and I feel this is a really sloppy use of it.

Is there a better way that is universal?

2 minutes ago, Dot said:

I'm writing an AIO fighter and I want my script to open doors if the closest attackable NPC is behind one (eg: Al-Kharid Warriors, some cunt closes a door in my face). Is there a better method for this than webwalking to the NPC's position?


target = npcs.closest(n -> n.getName().equals(targetName) && n.exists()
					&& n.getHealthPercent() > 0 && !myPlayer().isInteracting(n)
					&& !n.isUnderAttack() && n != null);
if (!map.canReach(target)) getWalking().webWalk(target.getPosition());
else {
	// do combat stuff
}

^^ that's sort of what I'm using but webWalk is heavy on resources and I feel this is a really sloppy use of it.

Is there a better way that is universal?

getDoorHandler().handleNextObstacle(target)

Edited by jca

  • Author
5 minutes ago, jca said:

getDoorHandler().handleNextObstacle(target)

Wow thanks. Didn't think it would be that simple.

  • Author
3 minutes ago, Juggles said:

simple way would be to

 


if (!map.canReach(npc) {
walking.webWalk(INSIDE_AREA); 
} else {
//kill shit
}

 

That's basically what I was using already but I want it to work when the area isn't necessarily known (hence using getPosition() as the area).  Also webWalk makes the client lag super hard.

17 minutes ago, Dot said:

That's basically what I was using already but I want it to work when the area isn't necessarily known (hence using getPosition() as the area).  Also webWalk makes the client lag super hard.

Oops sorry didn't read your code fully xD

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.