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.

creating area and path

Featured Replies

how would i declare an Area, Path, and how would i make my player follow the path to the new area.

how would i declare an Area, Path, and how would i make my player follow the path to the new area.

 

I can't help you with pathing as I haven't looked into it, but creating an area is pretty simple.

 

At the beginning of the script where you declare your global variables:

public static Area anArea = new Area(2519, 3578, 2522, 3581);

Make sure you import Area. 

 

As for how to know when your player is or is not in that area:

if (anArea.contains(this.client.getMyPlayer())) { //in area
	//code
}
else { //not in area
	//code		
}

 

Here's a visual representation of the area which that code would create:

 

RM7Hnhv.png

Edited by TheSaint

this is how I walk:

public void WalkTo(String Location) throws InterruptedException {
        Position Pos = null;
        Position [] WalkPath = {};
        int Radius = 8;
        int distance = 1000;

        if (Location.equals("bank")) {
            Pos = new Position(3271, 3167, 0);
            WalkPath = new Position [] {
                    new Position(3304, 3148, 0),
                    new Position(3282, 3151, 0),
                    new Position(3270, 3167, 0)
            };
        }
        if (Location.equals("house")) {
            WalkPath = new Position [] {
                    new Position(3282, 3151, 0),
                    new Position(3304, 3148, 0),
                    new Position(3321, 3142, 0)
            };
        }

        for (int I=0; I < WalkPath.length; I++) {
            if (myPlayer().getPosition().distance(WalkPath[I]) <= 2 && I < WalkPath.length-1) {
                Pos = WalkPath[I+1];
            } else if (distance > myPlayer().getPosition().distance(WalkPath[I])) {
                distance = myPlayer().getPosition().distance(WalkPath[I]);
                Pos = WalkPath[I];
            }
        }

        while (myPlayer().getPosition().distance(Pos) > 1) {
            distance = myPlayer().getPosition().distance(Pos);

            if (distance < 8) {
                Radius = distance;
            }

            int x = myPlayer().getPosition().getX();
            assert Pos != null;
            int x1 = Pos.getX();
            int y = myPlayer().getPosition().getY();
            int y1 = Pos.getY();

            double pureX = ((double) (x1 - x) / distance) * Radius;
            int dirX = (int)pureX;

            double pureY = ((double) (y1 - y) / distance) * Radius;
            int dirY = (int)pureY;

            walkMiniMap(new Position(x + dirX, y + dirY, 0));
            WaitWalking();
        }
    }

    public void WaitWalking() throws InterruptedException {
        sleep(random(150, 250));

        while (myPlayer().isMoving()) {
            sleep(random(50, 150));
        }
    }
Guest
This topic is now closed to further replies.

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.