Jump to content

How to walk in a (nightmare) instance?


Recommended Posts

Posted

Hey I was wondering if anyone could show me an example of how they walk in instances as I currently can not really figure it out myself. Currently I'm using the following code to walk, and the result is that it will just click far in the distance.

I have also tried the getWalking.Walk() function but that didn't do aanything

This is run when in a nightmare instance, I want to try to find a tile with no effects on them so I can stand there.

 List<Position> handPortals = this.graphicObjects
                            .getAll()
                            .stream()
                            .filter(c -> c.getId() == 1767)
                            .map(c -> c.getPosition())
                            .collect(Collectors.toList());
List<Position> playerArea = myPlayer().getArea(10).getPositions();
Position posToWalkTo = playerArea.stream().filter(c -> !handPortals.contains(c) && !playerArea.contains(nightmare)).findFirst().get();

posToWalkTo.interact(this.bot, "Walk here");

In another post frostbug says

Quote

I would recommend working with Local Positions (found by getLocalPosition methods). This is the position relative to the current map base. When time comes to walk to a position, translate your desired local position to an absolute position by adding the map base position to it (Map#getBaseX/Y).

But I couldn't find the getLocalPosition method, is this not used anymore in the current version of the OsBot API? And is there any other method I could use?

Thanks in advance for reading this.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...