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.

Rune Essence Portal Help

Featured Replies

I have the code, shown below, to exit the rune essence mine. It works 9/10 times, but in some instances, I am too far away from the portal. By 9/10 times, I mean it could happen once in 15 minutes, or once in 2-4 hours.

For some reason, it ends up grabbing another portal that's either too far away, or doesn't actually exist (at least, that's what it seemed like whilst debugging). Be it noted that the log for "Could not find the exit portal" is not being displayed while trying to exit through this portal, until I get closer.

Stream.concat(getNpcs().getAll().stream(), getObjects().getAll().stream())
	      	.filter(entity -> entity.getName().contains("Portal"))
	      	.min((portal1, portal2) -> Integer.compare(myPosition().distance(portal1.getPosition()), myPosition().distance(portal2.getPosition())))
	      	.ifPresent(portal -> {
	      		if (portal.interact("Exit", "Use", "Enter")) {
	      			new ConditionalSleep(10000) {
	      				@Override
	      				public boolean condition() throws InterruptedException {
	      					return teleportArea.contains(myPosition());
	      				}
	      			}.sleep();
	      		} else {
	      			log("Could not find the exit portal.");
	      		}
	      	});

 

myPosition.png

portalPosition.png

Edited by BrainDeadGenius

Never personally dealt with this, but for an idea you could make a loop to test all the different types until it is not null.

Name is blue -> NPC

3f122e14ade346c2ad22c7b39dd9d2d5.png

 

npc.getDefinition().getId()

 

165c27427eda4e96a2eedec99c49608e.png

The name has some formatting to make it blue, usually NPCs are yellow so that is the reason there is formatting.

Edited by House

  • Author
1 minute ago, House said:

Name is blue -> NPC

6a5a5fc5cd8b426ea6cd7113127bd324.png

 

npc.getDefinition().getModelIds()[0]

It's showing up as an NPC right now, and getting it by nps.closest("Portal") or getNpcs.closest("Portal") both return null.

2 minutes ago, House said:

Name is blue -> NPC

3f122e14ade346c2ad22c7b39dd9d2d5.png

 

npc.getDefinition().getId()

He said that it is not always a NPC, is that not the case? 

  • Author
Just now, Manner said:

He said that it is not always a NPC, is that not the case? 

No, it's not always an NPC. But it is right now, and it's returning null anyways.

Just now, BrainDeadGenius said:

It's showing up as an NPC right now, and getting it by nps.closest("Portal") or getNpcs.closest("Portal") both return null.

 

Just now, Manner said:

He said that it is not always a NPC, is that not the case? 

 

Just.. i edited my post with more details xD

read

  • Author
1 minute ago, House said:

 

 

Just.. i edited my post with more details xD

read

The others used .closest("Portal") and it would work. Same setup with the name, just a different color. But I get that.

Best method is to use

exitPortalPlayer = getPlayers().closest(o -> o.getName().contains("Portal"));
exitPortalNPC = getNpcs().closest(o -> o.getName().contains("Portal"));
exitPortalEntity = getObjects().closest(o -> o.getName().contains("Portal"));

 

1 minute ago, BrainDeadGenius said:

The others used .closest("Portal") and it would work. Same setup with the name, just a different color. But I get that.

Best method is to use


exitPortalPlayer = getPlayers().closest(o -> o.getName().contains("Portal"));
exitPortalNPC = getNpcs().closest(o -> o.getName().contains("Portal"));
exitPortalEntity = getObjects().closest(o -> o.getName().contains("Portal"));

 

 The reason it doesn't work is because of the unique color essentially yeah :p

  • Author
7 minutes ago, House said:

 The reason it doesn't work is because of the unique color essentially yeah :p

Well the thing is, it would work by grabbing closest portal, sometimes. I think this was only happening when it was an object though. Just damn weird.

43 minutes ago, BrainDeadGenius said:

So, I've been trying to work out a rune essence miner. And I'm able to get everything to work of course, except for one thing. The portal to leave.

 

It looks like the portal changes ID's and names (The color is included in the name) randomly every 1-3 trips to the mine. That's no problem when you grab it by name. However, it also appears that the type of object you're trying to grab changes as well. Sometimes, the portal will be an NPC. Sometimes, it will be any form of object. And at other times, it might even be a player (haven't confirmed this yet). But, there's apparently another form of object that it can take that I have not accounted for. So, the portal returns null. View the GIF below. Suggestions are welcome.

 

https://gyazo.com/ede7dc8104e62b6ffd6ed4fcdea57c4d

 

This is what I used:

Stream.concat(getObjects().getAll().stream(), getNpcs().getAll().stream())
      .filter(entity -> entity.getName().contains("Portal"))
      .findAny()
      .ifPresent(portal -> {
          if (portal.interact("Use", "Exit")) {
              Sleep.sleepUntil(() -> !portal.isVisible(), 10_000);
          }
      });

 

  • Author
6 minutes ago, Explv said:

 

This is what I used:


Stream.concat(getObjects().getAll().stream(), getNpcs().getAll().stream())
      .filter(entity -> entity.getName().contains("Portal"))
      .findAny()
      .ifPresent(portal -> {
          if (portal.interact("Use", "Exit")) {
              Sleep.sleepUntil(() -> !portal.isVisible(), 10_000);
          }
      });

 

The portal variable contains the correct information, but it's refusing to interact with it (I changed your sleep class to my own method).

1 minute ago, BrainDeadGenius said:

The portal variable contains the correct information, but it's refusing to interact with it (I changed your sleep class to my own method).

 

Maybe the interact is "Enter" ?

  • Author
15 minutes ago, House said:

 

Maybe the interact is "Enter" ?

No, it's "Use", but I did add that to the list for future reference.

https://gyazo.com/c28af0887dddf60da0336e4a53ecf85d

That was a new occurrence, and it's worked so far since I've taken manual control for that one instance.

Edited by BrainDeadGenius

  • Author

I'm going to reply to this instead of making a new thread. I've updated the original post and title to indicate the issue. Only happens every so often (could be 15 minutes, or once every 2-4 hours. It depends).

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.