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.

Display Area

Featured Replies

How would some display an area? im not talking about getting all position in an area and displaying them all out. I want like the outline of the area.

How would some display an area? im not talking about getting all position in an area and displaying them all out. I want like the outline of the area.

Sorry if this is wrong, had < 5 to do it.

you get the gist though... fix and use:

 Position[] areaBounds(Position tile1, Position tile2){
        List<Position> tiles = new LinkedList<Position>();
        //TOP
        if(tile1.getX() > tile2.getX()){
            for(int i = tile1.getX(); i != tile2.getX(); i--){
               tiles.add(new Position(i, tile1.getY(), tile1.getZ()));
            }
        }else if(tile1.getX() < tile2.getX()){
            for(int i = tile1.getX(); i != tile2.getX(); i++){
                tiles.add(new Position(i, tile1.getY(), tile1.getZ()));
            }
        }
       //Side 1
        if(tile1.getY() > tile2.getY()){
            for(int i = tile1.getY(); i != tile2.getY(); i--){
                tiles.add(new Position(tile1.getX(), i, tile1.getZ()));
            }
        }else if(tile1.getY() < tile2.getY()){
            for(int i = tile1.getY(); i != tile2.getY(); i++){
                tiles.add(new Position(tile1.getX(), i, tile1.getZ()));
            }
        }

       //side 2
        if(tile2.getY() > tile1.getY()){
            for(int i = tile2.getY(); i != tile1.getX(); i--){
                tiles.add(new Position(tile2.getX(), i, tile2.getZ()));
            }
        }else if(tile2.getY() < tile1.getY()){
            for(int i = tile2.getY(); i != tile1.getX(); i++){
                tiles.add(new Position(tile2.getX(), i, tile2.getZ()));
            }
        }
        //bottom
        if(tile2.getX() > tile1.getX()){
            for(int i = tile2.getX(); i != tile1.getX(); i--){
                tiles.add(new Position(i, tile1.getY(), tile1.getZ()));
            }
        }else if(tile2.getX() < tile1.getX()){
            for(int i = tile2.getX(); i != tile1.getX(); i++){
                tiles.add(new Position(tile2.getX(), i, tile2.getZ()));
            }
        }

        //convert list to array, return array or convert constructor to list
       return null;
    }

Edited by Isolate

Ffs, editing post on my phone just fucked up te formattiñg, I'll be home in two hours to fix

  • Author

Sorry if this is wrong, had < 5 to do it.

you get the gist though... fix and use:

Position[] areaBounds(Position tile1, Position tile2){
        List<Position> tiles = new LinkedList<Position>();
        //TOP
        if(tile1.getX() > tile2.getX()){
            for(int i = tile1.getX(); i != tile2.getX(); i--){
               tiles.add(new Position(i, tile1.getY(), tile1.getZ()));
            }
        }else if(tile1.getX() < tile2.getX()){
            for(int i = tile1.getX(); i != tile2.getX(); i++){
                tiles.add(new Position(i, tile1.getY(), tile1.getZ()));
            }
        }
       //Side 1
        if(tile1.getY() > tile2.getY()){
            for(int i = tile1.getY(); i != tile2.getY(); i--){
                tiles.add(new Position(tile1.getX(), i, tile1.getZ()));
            }
        }else if(tile1.getY() < tile2.getY()){
            for(int i = tile1.getY(); i != tile2.getY(); i++){
                tiles.add(new Position(tile1.getX(), i, tile1.getZ()));
            }
        }

       //side 2
        if(tile2.getY() > tile1.getY()){
            for(int i = tile2.getY(); i != tile1.getX(); i--){
                tiles.add(new Position(tile2.getX(), i, tile2.getZ()));
            }
        }else if(tile2.getY() < tile1.getY()){
            for(int i = tile2.getY(); i != tile1.getX(); i++){
                tiles.add(new Position(tile2.getX(), i, tile2.getZ()));
            }
        }
        //bottom
        if(tile2.getX() > tile1.getX()){
            for(int i = tile2.getX(); i != tile1.getX(); i--){
                tiles.add(new Position(i, tile1.getY(), tile1.getZ()));
            }
        }else if(tile2.getX() < tile1.getX()){
            for(int i = tile2.getX(); i != tile1.getX(); i++){
                tiles.add(new Position(tile2.getX(), i, tile2.getZ()));
            }
        }

        //convert list to array, return array or convert constructor to list
       return null;
    }
What it looks like your creating an outline with position for the area are you not?

Return tiles.toArray(new Position[tiles.size()]); // I did this on my phone so bare with me

What it looks like your creating an outline with position for the area are you not?

Return tiles.toArray(new Position[tiles.size()]); // I did this on my phone so bare with me

I thought that's what you wanted? 

I swear people don't know how to use arrays and resort to lists for everything.

Feels easier.

  • Author

I thought that's what you wanted? 

Feels easier.

It's a nice idea but i was looking for like a complete outline of the area not like many different position that creates a rectangle. Do you get me, like find the corner of the two position and draw one large rectangle off two points

It's a nice idea but i was looking for like a complete outline of the area not like many different position that creates a rectangle. Do you get me, like find the corner of the two position and draw one large rectangle off two points

Oh I seee.

would be same result though no?


PositionPolygon pp = new PositionPolygon(area.getMinX(), area.getMinY(), area.getMaxX(), area.getMaxY());

graphics.draw(pp.toGeometricArea());

Edited by FrostBug

  • Author
PositionPolygon pp = new PositionPolygon(area.getMinX(), area.getMinY(), area.getMaxX(), area.getMaxY());
graphics.draw(pp.toGeometricArea());

Is it really that easy :o

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.