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.

LocalPathFinder

Featured Replies

You can pass flags to it after filtering through getMap().getRegion().getClippingPlanes()[myPosition.getZ()].getTileFlags();

        int[][] originalFlags = getMap().getRegion().getClippingPlanes()[self.myPosition().getZ()].getTileFlags();
        int[][] modifiedFlags = new int[originalFlags.length][originalFlags.length];
        pathFinder = new LocalPathFinder(getBot());
       
        for (int x = 0; x < originalFlags.length; x++) {
            for (int y = 0; y < originalFlags.length; y++) {
                int originalFlag = originalFlags[x][y];
                /* modify originalFlag flag here */     
                modifiedFlags[x][y] = originalFlag;
            }
        }
        pathFinder.findPath(targetPosition, modifiedFlags);
  • Author

 

You can pass flags to it after filtering through getMap().getRegion().getClippingPlanes()[myPosition.getZ()].getTileFlags();

        int[][] originalFlags = getMap().getRegion().getClippingPlanes()[self.myPosition().getZ()].getTileFlags();
        int[][] modifiedFlags = new int[originalFlags.length][originalFlags.length];
        pathFinder = new LocalPathFinder(getBot());
       
        for (int x = 0; x < originalFlags.length; x++) {
            for (int y = 0; y < originalFlags.length; y++) {
                int originalFlag = originalFlags[x][y];
                /* modify originalFlag flag here */     
                modifiedFlags[x][y] = originalFlag;
            }
        }
        pathFinder.findPath(targetPosition, modifiedFlags);

Could you give me an example of modifiedflag for ignoring object ?

Could you give me an example of modifiedflag for ignoring object ?

 

1 = cannot enter from west

2 = cannot enter from east

4 = cannot enter from north

8 = cannot enter from south

Cannot enter from west and east = 1 | 2

Cannot enter from west, east and north = 1 | 2 | 4

etc :)

  • Author

1 = cannot enter from west

2 = cannot enter from east

4 = cannot enter from north

8 = cannot enter from south

Cannot enter from west and east = 1 | 2

Cannot enter from west, east and north = 1 | 2 | 4

etc smile.png

 

So all i have to do is loop through object, get their position and change their flags to 0 to ignore those tiles?

Edited by Ayylmao420

So all i have to do is loop through object, get their position and change their flags to 0 to ignore those tiles?

 

Pretty much, yes.

 

I think you should be able to do:

modifiedFlags[objToRemove.getLocalY()][objToRemove.getLocalX()] = 0;

Be careful when setting flags to zero though, the pathfinder will see it as a tile that can be accessed from all directions, so might end up generating a unwalkable path

  • Author

Be careful when setting flags to zero though, the pathfinder will see it as a tile that can be accessed from all directions, so might end up generating a unwalkable path

Alright, thanks for the help guys.

 

EDIT:/

I just figured out that for some reason when i do this;

	        for (RS2Object object : getObjects().getAll()) {
	        	if (object.getName().equals("Large door")) {
	        		modifiedFlags[object.getLocalX()][object.getLocalY()] = 0;
	        	}
	        }

It'll work for doors, gates but for some reason it doesn't work with large doors, any ideas ?

Edited by Ayylmao420

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.