Package org.dreambot.api.methods.map
Class Map
- java.lang.Object
- 
- org.dreambot.api.methods.map.Map
 
- 
 public class Map extends java.lang.ObjectA class which houses methods related to Region and Map.- Since:
- 11/22/14
 
- 
- 
Method SummaryAll Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static voidaddObstacleActions(java.lang.String... actions)Deprecated.no longer used, please usePathFinder.addObstacle(PathObstacle)insteadstatic booleancanReach(Tile destination)Determines if the given destination tile is reachable from your current local players position, and not blocked by any objects/obstacles.static booleancanReach(Tile destination, boolean offsetDestination)Determines if the given destination tile reachable from your current local players position, and not blocked by any objects/obstacles.static booleancanReach(Tile start, Tile destination)Determines if the given destination tile reachable from the given start tile, and not blocked by any objects/obstacles.static booleancanReach(Tile start, Tile destination, boolean offsetDestination)Determines if the given destination tile reachable from the given start tile, and not blocked by any objects/obstacles.static booleancanReach(Entity destination)Determines if the given destination Entity is reachable from your current local players position, and not blocked by any objects/obstacles.static voidclearGameObjectCache()static intcostToTile(int startX, int startY, int destinationX, int destinationY, boolean offsetDestination)static intcostToTile(int startX, int startY, int destinationX, int destinationY, int z, boolean offsetDestination)static intexactDistance(Tile destination)Calculates the exact distance (number of tiles) your current player is away from destination.static intexactDistance(Tile destination, boolean offsetDestination)Determines if the given destination tile reachable from your current local players position, and not blocked by any objects/obstacles.static intexactDistance(Tile start, Tile destination)Determines if the given destination tile reachable from the given start tile, and not blocked by any objects/obstacles.static intexactDistance(Tile start, Tile destination, boolean offsetDestination)Determines if the given destination tile reachable from the given start tile, and not blocked by any objects/obstacles.static intexactDistance(Entity destination)Calculates the exact distance (number of tiles) your current player is away from destination.static java.awt.RectanglegetBounds(Tile tile)Gets the on-screen rectangle bounds of the given tile.static intgetFlag(Tile tile)Gets collision flag for the given tile.static TilegetGridLocation(Tile tile)Gets the grid location of the tile.static intgetGridX(Tile tile)Gets the x location of a tile on the region grid.static intgetGridY(Tile tile)Gets the grid y value of a tilestatic MiniMapTileDestinationgetMiniMapDestination(Tile tile)Gets the mini map Destination for the given tile.static java.awt.ShapegetMinimapShape()Gets a generated shape reference for the minimap widget.static java.awt.ShapegetMinimapShape(int diameterIncrease)static @Nullable GameObject[]getObjectsAtTile(Tile tile)Gets theGameObjects at the given tile.static GameObject[]getObjectsAtTile(Tile tile, boolean cachedResults)Gets theGameObjects at the given tile.static java.util.List<java.lang.String>getObstacleActions()Deprecated.no longer used, seeLocalPathFinderinsteadstatic java.util.HashMap<Tile,TileObstacle>getObstacleLocations()Deprecated.no longer used, seeLocalPathFinderinsteadstatic java.awt.PolygongetPolygon(Tile tile)Gets the on-screen polygon of the given tile.static TileReference[][]getTileGrid(int plane)Get the reference of the given tile object.static intgetTileHeight(Tile tile)Gets the height of a tile.static TileReferencegetTileReference(int localX, int localY, int z)static TileReferencegetTileReference(Tile tile)Get the reference of the given tile object.static java.awt.Point[]getVertices(Tile tile)Gets an array of points which represent the bounds of a tile.static TilegetWalkable(Tile tile)Gets a walkable tile which is closest the given tile.static booleanhoveringMinimap()static booleaninteract(Tile tile)Interacts with the given tile on the map by left-clicking.static booleaninteract(Tile tile, java.lang.String action)Interacts with the given tile on the map using the given action.static booleanisClickable(Tile tile)Checks if you can click this tile either on screen or on minimap.static booleanisLocal(Tile tile)Determines if given tile is local.static booleanisTileOnMap(Tile tile)Determines if the given tile is current visible on the mini map.static booleanisTileOnScreen(Tile tile)Is tile on screen.static booleanisVisible(Tile tile)Checks if theTileis visible on the main screen.static voidremoveObstacleActions(java.lang.String... actions)Deprecated.no longer used, please usePathFinder.removeObstacle(PathObstacle)insteadstatic voidreset()static java.awt.PointtileToMiniMap(Tile tile)Gets the given tile location on the mini map.static java.awt.PointtileToScreen(Tile tile)Gets the current screen position of the given tile.
 
- 
- 
- 
Method Detail- 
isVisiblepublic static boolean isVisible(Tile tile) Checks if theTileis visible on the main screen.- Parameters:
- tile- to check visibly of.
- Returns:
- True if visible, else False
 
 - 
getWalkablepublic static Tile getWalkable(Tile tile) Gets a walkable tile which is closest the given tile.- Parameters:
- tile- the tile to find the closest walkable tile for.
- Returns:
- the walkable tile, nearest to the given tile.
 
 - 
getTileReferencepublic static TileReference getTileReference(Tile tile) Get the reference of the given tile object.- Parameters:
- tile- the tile you wish to get the reference for.
- Returns:
- the tile reference for the given object.
 
 - 
getTileReferencepublic static TileReference getTileReference(int localX, int localY, int z) 
 - 
getTileGridpublic static TileReference[][] getTileGrid(int plane) Get the reference of the given tile object.- Returns:
- the tile reference for the given object.
 
 - 
getMinimapShapepublic static java.awt.Shape getMinimapShape() Gets a generated shape reference for the minimap widget.- Returns:
- the minimap shape object.
 
 - 
getMinimapShapepublic static java.awt.Shape getMinimapShape(int diameterIncrease) 
 - 
hoveringMinimappublic static boolean hoveringMinimap() 
 - 
getTileHeightpublic static int getTileHeight(Tile tile) Gets the height of a tile.- Parameters:
- tile- the tile you wish to get the height of.
- Returns:
- height of the given tile.
 
 - 
getGridXpublic static int getGridX(Tile tile) Gets the x location of a tile on the region grid.- Parameters:
- tile- the tile to get the grid x position of.
- Returns:
- the x location of the tile on the region grid.
 
 - 
getGridYpublic static int getGridY(Tile tile) Gets the grid y value of a tile- Parameters:
- tile- the tile
- Returns:
- The grid y value.
 
 - 
getGridLocationpublic static Tile getGridLocation(Tile tile) Gets the grid location of the tile.- Parameters:
- tile- the tile you wish to get the grid position of.
- Returns:
- The grid location of the tile.
 
 - 
getVerticespublic static java.awt.Point[] getVertices(Tile tile) Gets an array of points which represent the bounds of a tile.- Parameters:
- tile- the tile you wish to get the points of.
- Returns:
- array of points which represent the bounds of the tile.
 
 - 
getBoundspublic static java.awt.Rectangle getBounds(Tile tile) Gets the on-screen rectangle bounds of the given tile.- Parameters:
- tile- the tile you wish to get the bounds of.
- Returns:
- the rectangle bounds of the given tile.
 
 - 
getPolygonpublic static java.awt.Polygon getPolygon(Tile tile) Gets the on-screen polygon of the given tile.- Parameters:
- tile- the tile you wish to get the polygon of.
- Returns:
- the polygon of the given tile.
 
 - 
isLocalpublic static boolean isLocal(Tile tile) Determines if given tile is local.- Parameters:
- tile- the tile to check.
- Returns:
- true if tile is local(in region), otherwise false.
 
 - 
getObjectsAtTilepublic static @Nullable GameObject[] getObjectsAtTile(Tile tile) Gets theGameObjects at the given tile.- Parameters:
- tile- the tile to get the objects with.
- Returns:
- the array of GameObjects located at the given tile.
 
 - 
getObjectsAtTilepublic static GameObject[] getObjectsAtTile(Tile tile, boolean cachedResults) Gets theGameObjects at the given tile.- Parameters:
- tile- the tile to get the objects with.
- cachedResults- true if you'd like to use the cache, false otherwise
- Returns:
- the array of GameObjects located at the given tile.
 
 - 
getMiniMapDestinationpublic static MiniMapTileDestination getMiniMapDestination(Tile tile) Gets the mini map Destination for the given tile.- Parameters:
- tile- the tile to get the mini map destination of.
- Returns:
- the mini map destination for the given tile.
 
 - 
tileToMiniMappublic static java.awt.Point tileToMiniMap(Tile tile) Gets the given tile location on the mini map.- Parameters:
- tile- the tile to get the mini map location of.
- Returns:
- the point of the tile location on the mini map.
 
 - 
tileToScreenpublic static java.awt.Point tileToScreen(Tile tile) Gets the current screen position of the given tile.- Parameters:
- tile- the tile to get the screen position from.
- Returns:
- the point of the tile location on the screen.
 
 - 
isTileOnMappublic static boolean isTileOnMap(Tile tile) Determines if the given tile is current visible on the mini map.- Parameters:
- tile- the tile to check location of.
- Returns:
- False if on a different Z as your player, true if given tile is located on the mini map, otherwise false.
 
 - 
isTileOnScreenpublic static boolean isTileOnScreen(Tile tile) Is tile on screen.- Parameters:
- tile- the tile
- Returns:
- the boolean
 
 - 
isClickablepublic static boolean isClickable(Tile tile) Checks if you can click this tile either on screen or on minimap. If minimap is disabled, it will only check for on screen.- Parameters:
- tile- tile to check
- Returns:
- true if on screen or if minimap is not disabled and it's on minimap.
 
 - 
getFlagpublic static int getFlag(Tile tile) Gets collision flag for the given tile.- Parameters:
- tile- the tile to get the collision flag for.
- Returns:
- the collision flag for the given tile.
 
 - 
interactpublic static boolean interact(Tile tile) Interacts with the given tile on the map by left-clicking.- Parameters:
- tile- the tile to interact with.
- Returns:
- true if successfully interacted, otherwise false.
 
 - 
interactpublic static boolean interact(Tile tile, java.lang.String action) Interacts with the given tile on the map using the given action.- Parameters:
- tile- the tile to interact with.
- action- the action you wish to preform.
- Returns:
- true if successfully interacted, otherwise false.
 
 - 
canReachpublic static boolean canReach(Entity destination) Determines if the given destination Entity is reachable from your current local players position, and not blocked by any objects/obstacles.- Parameters:
- destination- the destination entity you want to determine reachable.
- Returns:
- true if your player is able to reach the destination, otherwise false.
 
 - 
canReachpublic static boolean canReach(Tile destination) Determines if the given destination tile is reachable from your current local players position, and not blocked by any objects/obstacles.- Parameters:
- destination- the destination tile you want to determine reachable.
- Returns:
- true if your player is able to reach the destination, otherwise false.
 
 - 
canReachpublic static boolean canReach(Tile start, Tile destination) Determines if the given destination tile reachable from the given start tile, and not blocked by any objects/obstacles.- Parameters:
- start- the tile you wish start your search from.
- destination- the destination tile you want to determine reachable.
- Returns:
- true if the destination tile is reachable from the start tile, otherwise false.
 
 - 
canReachpublic static boolean canReach(Tile destination, boolean offsetDestination) Determines if the given destination tile reachable from your current local players position, and not blocked by any objects/obstacles.- Parameters:
- destination- the destination tile you want to determine reachable.
- offsetDestination- if true, will search for any walkable surrounding tile in the event the destination is not walkable.
- Returns:
- true if your player is able to reach the destination, otherwise false.
 
 - 
canReachpublic static boolean canReach(Tile start, Tile destination, boolean offsetDestination) Determines if the given destination tile reachable from the given start tile, and not blocked by any objects/obstacles.- Parameters:
- start- the tile you wish start your search from.
- destination- the destination tile you want to determine reachable.
- offsetDestination- if true, will search for any walkable surrounding tile in the event the destination is not walkable.
- Returns:
- true if the destination tile is reachable from the start tile, otherwise false.
 
 - 
exactDistancepublic static int exactDistance(Entity destination) Calculates the exact distance (number of tiles) your current player is away from destination. If the path is blocked the method will return -1.- Parameters:
- destination- the destination entity you want to calculate tile distance of.
- Returns:
- the exact distance away (number of tiles) if your player is able to reach the destination, otherwise -1.
 
 - 
exactDistancepublic static int exactDistance(Tile destination) Calculates the exact distance (number of tiles) your current player is away from destination.- Parameters:
- destination- the destination entity you want to calculate tile distance of.
- Returns:
- the exact distance away (number of tiles) if your player is able to reach the destination, otherwise -1.
 
 - 
exactDistancepublic static int exactDistance(Tile start, Tile destination) Determines if the given destination tile reachable from the given start tile, and not blocked by any objects/obstacles.- Parameters:
- start- the tile you wish start your search from.
- destination- the destination entity you want to calculate tile distance of.
- Returns:
- the exact distance away (number of tiles) from the start tile if it is able to reach the destination, otherwise -1.
 
 - 
exactDistancepublic static int exactDistance(Tile destination, boolean offsetDestination) Determines if the given destination tile reachable from your current local players position, and not blocked by any objects/obstacles.- Parameters:
- destination- the destination entity you want to calculate tile distance of.
- offsetDestination- if true, will search for any walkable surrounding tile in the event the destination is not walkable.
- Returns:
- the exact distance away (number of tiles) from the start tile if it is able to reach the destination, otherwise -1.
 
 - 
exactDistancepublic static int exactDistance(Tile start, Tile destination, boolean offsetDestination) Determines if the given destination tile reachable from the given start tile, and not blocked by any objects/obstacles.- Parameters:
- start- the tile you wish start your search from.
- destination- the destination entity you want to calculate tile distance of.
- offsetDestination- if true, will search for any walkable surrounding tile in the event the destination is not walkable.
- Returns:
- the exact distance away (number of tiles) from the start tile if it is able to reach the destination, otherwise -1.
 
 - 
getObstacleLocations@Deprecated public static java.util.HashMap<Tile,TileObstacle> getObstacleLocations() Deprecated.no longer used, seeLocalPathFinderinstead
 - 
getObstacleActions@Deprecated public static java.util.List<java.lang.String> getObstacleActions() Deprecated.no longer used, seeLocalPathFinderinstead
 - 
addObstacleActions@Deprecated public static void addObstacleActions(java.lang.String... actions) Deprecated.no longer used, please usePathFinder.addObstacle(PathObstacle)instead
 - 
removeObstacleActions@Deprecated public static void removeObstacleActions(java.lang.String... actions) Deprecated.no longer used, please usePathFinder.removeObstacle(PathObstacle)instead
 - 
costToTilepublic static int costToTile(int startX, int startY, int destinationX, int destinationY, boolean offsetDestination)
 - 
costToTilepublic static int costToTile(int startX, int startY, int destinationX, int destinationY, int z, boolean offsetDestination)
 - 
clearGameObjectCachepublic static void clearGameObjectCache() 
 - 
resetpublic static void reset() 
 
- 
 
-