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.

Door Handler

Featured Replies

According to the API I can check if an entity is reachable: https://osbot.org/api/org/osbot/rs07/api/DoorHandler.html#canReachOrOpen-org.osbot.rs07.api.model.Entity-

However the following always returns true even if it should return false:

NPC juliet = script.npcs.closest("Juliet");
log(getDoorHandler().canReachOrOpen(juliet.getPosition()));

 

Edited by harrypotter

22 minutes ago, harrypotter said:

According to the API I can check if an entity is reachable: https://osbot.org/api/org/osbot/rs07/api/DoorHandler.html#canReachOrOpen-org.osbot.rs07.api.model.Entity-

However the following always returns true even if it should return false:


NPC juliet = script.npcs.closest("Juliet");
log(getDoorHandler().canReachOrOpen(juliet));

 

Juliet isn't a door though?

I'd do something like this:

if (julietArea.contains(myPlayer()) {
	RS2Object door = getObjects.closest("Door");
	if (door != null && door.hasAction("Open")) {
		door.interact("Open");
	}
	
	// then rest of code to interact with the NPC "Juliet"

}

EDIT: julietArea being the area you are in when wanting to interact with Juliet. Use @Explv 's dope map to find the area for it by going up a floor (https://explv.github.io/).

Edited by Magarac

  • Author
19 minutes ago, Magarac said:

Juliet isn't a door though?

I'd do something like this:


if (julietArea.contains(myPlayer()) {
	RS2Object door = getObjects.closest("Door");
	if (door != null && door.hasAction("Open")) {
		door.interact("Open");
	}
	
	// then rest of code to interact with the NPC "Juliet"

}

EDIT: julietArea being the area you are in when wanting to interact with Juliet. Use @Explv 's dope map to find the area for it by going up a floor (https://explv.github.io/).

Sorry my snippet should read: 

NPC juliet = script.npcs.closest("Juliet");
log(getDoorHandler().canReachOrOpen(juliet.getPosition()));

This still returns true for the position, even if behind a door.

Edited by harrypotter

3 minutes ago, harrypotter said:

Sorry my snippet should read: 


NPC juliet = script.npcs.closest("Juliet");
log(getDoorHandler().canReachOrOpen(juliet.getPosition()));

This still returns true for the area, even if behind a door.

Hmm I'm not exactly sure why it's returning true, other than the fact that (reach || open) might be working like an OR statement does and since it CAN open the door it returns true always. Try doing the door check like I posted, cause doors always have either a "Open" or "Close" option.

  • Author
2 minutes ago, Magarac said:

Hmm I'm not exactly sure why it's returning true, other than the fact that (reach || open) might be working like an OR statement does and since it CAN open the door it returns true always. Try doing the door check like I posted, cause doors always have either a "Open" or "Close" option.

You could be right, flew straight over my head the naming there haha!

if(getMap().canReach(juliet))

      juliet.inteact("Talk-to");

else 

     getWalking().webWalk(juliet.getPosition()); //or if you want to manually handle the door feel free to 

Quote

Juliet isn't a door though?

I died laughing after reading this

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.