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.

getPositionTileFlag() / getLocalPositionTileFlag [Snippet]

Featured Replies


package mapdata.Botrepreneur;

import org.osbot.rs07.api.map.Position;

import org.osbot.rs07.script.Script;

public class FlagMethods {

/**

* @author Botrepreneur

* @Version: 00.20 *Deux*

*/

public static Flag getPositionTileFlag(Script script, Position position) {

int flagValue = script.getClient().accessor.getClippingPlanes()[script.getClient().accessor.getPlane()].getTileFlags()[position.getLocalX(script.getBot())][position.getLocalY(script.getBot())];

return FlagMethods.getFlag(flagValue);

}

public static Flag getLocalPositionTileFlag(Script script, Position localPosition) {

int flagValue = script.getClient().accessor.getClippingPlanes()[script.getClient().accessor.getPlane()].getTileFlags()[localPosition.getX()][localPosition.getY()];

return FlagMethods.getFlag(flagValue);

}

public static Flag getLocalPositionTileFlag(Script script, int localX, int localY) {

int flagValue = script.getClient().accessor.getClippingPlanes()[script.getClient().accessor.getPlane()].getTileFlags()[localX][localY];

return FlagMethods.getFlag(flagValue);

}

private static Flag getFlag(int flagValue) {

if (flagValue == 0) {

return Flag.NULL;

} else {

for (int i = 0; i < Flag.values().length; i++) {

if ((Flag.values().getFlag() & flagValue) != 0) {

return Flag.values();

}

}

}

return null;

}

}


package mapdata.Botrepreneur;

import java.awt.Color;

public enum Flag {

/**

* @author Botrepreneur

* @Version: 00.00 *Deux*

*/

WALL_NORTHWEST(0x1, Color.ORANGE),

WALL_NORTH(0x2, Color.ORANGE),

WALL_NORTHEAST(0x4, Color.ORANGE),

WALL_EAST(0x8, Color.ORANGE),

WALL_SOUTHEAST(0x10, Color.ORANGE),

WALL_SOUTH(0x20, Color.ORANGE),

WALL_SOUTHWEST(0x40, Color.ORANGE),

WALL_WEST(0x80, Color.ORANGE),

OBJECT_TILE(0x100, Color.RED.brighter()),

WALL_BLOCK_NORTHWEST(0x200, Color.ORANGE.darker()),

WALL_BLOCK_NORTH(0x400, Color.ORANGE.darker()),

WALL_BLOCK_NORTHEAST(0x800, Color.ORANGE.darker()),

WALL_BLOCK_EAST(0x1000, Color.ORANGE.darker()),

WALL_BLOCK_SOUTHEAST(0x2000, Color.ORANGE.darker()),

WALL_BLOCK_SOUTH(0x4000, Color.ORANGE.darker()),

WALL_BLOCK_SOUTHWEST(0x8000, Color.ORANGE.darker()),

WALL_BLOCK_WEST(0x10000, Color.ORANGE.darker()),

OBJECT_BLOCK(0x20000, Color.RED.darker()),

DECORATION_BLOCK(0x40000, Color.PINK),

WALL_ALLOW_RANGE_NORTHWEST(0x400000, Color.ORANGE.brighter()),

WALL_ALLOW_RANGE_NORTH(0x800000, Color.ORANGE.brighter()),

WALL_ALLOW_RANGE_NORTHEAST(0x1000000, Color.ORANGE.brighter()),

WALL_ALLOW_RANGE_EAST(0x2000000, Color.ORANGE.brighter()),

WALL_ALLOW_RANGE_SOUTHEAST(0x4000000, Color.ORANGE.brighter()),

WALL_ALLOW_RANGE_SOUTH(0x8000000, Color.ORANGE.brighter()),

WALL_ALLOW_RANGE_SOUTHWEST(0x10000000, Color.ORANGE.brighter()),

WALL_ALLOW_RANGE_WEST(0x20000000, Color.ORANGE.brighter()),

OBJECT_ALLOW_RANGE(0x40000000, Color.ORANGE.brighter()),

WATER(0x200000, Color.BLUE),

NULL(0x0, Color.GREEN);

private int flag;

private Color color;

Flag(final int flag, final Color color) {

this.flag = flag;

this.color = color;

}

public int getFlag() {

return this.flag;

}

public Color getColor() {

return this.color;

}

public String toString() {

return this.name();

}

}

Edited by Botrepreneur

I probably meant to override the method but apparently never did ph34r.png

it returns #name() by default
  • Author

it returns #name() by default

 

I know, I meant to do this:

 

24dc3e5d97f8244a3035d495a03c87cc.png

 

But forgot to apply the method and never noticed it considering I actually never use the toString for that enum :p

 

Anyways, fixed now ^^

I know, I meant to do this:

 

24dc3e5d97f8244a3035d495a03c87cc.png

 

But forgot to apply the method and never noticed it considering I actually never use the toString for that enum tongue.png

 

Anyways, fixed now ^^

You should fix it in your OP then. o.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.