OSRS Plugin API
    Preparing search index...

    Class MapCoord

    Index

    Properties

    level: number

    level component of the current coordinate.

    -- Create a new Coord
    local coord = osrs.MapCoord.new(1, 10, 10)
    -- Print the coords level
    osrs.print(tostring(coord.level))
    -- Change its level to 2
    coord.level = 2
    -- Print the coords new level
    osrs.print(tostring(coord.level))
    x: number

    x component of the current coordinate.

    -- Create a new Coord
    local coord = osrs.MapCoord.new(1, 10, 10)
    -- Print the x component of the current coord
    osrs.print(tostring(coord.x))
    -- Change its x component to 5
    coord.x = 5
    -- Print the coords new x
    osrs.print(tostring(coord.x))
    z: number

    z component of the current coordinates.

    -- Create a new Coord
    local coord = osrs.MapCoord.new(1, 10, 10)
    -- Print the z component of the current coord
    osrs.print(tostring(coord.z))
    -- Change its x component to 5
    coord.z = 5
    -- Print the coords new z
    osrs.print(tostring(coord.z))

    Methods

    • returns a version of this Coord as a Fine-space Coordinate.

      Returns FineCoord

      local coord = osrs.ClientOp.coord()
      local fineCoord = coord:getFineCoordinate()
      osrs.printf("Map Coord - X: %d, level: %d, z: %d", coord.x, coord.level, coord.z)
      osrs.printf("Fine Coord - X: %d, y: %d, z: %d", fineCoord.x, fineCoord.y, fineCoord.z)
    • returns the four corners of this Coord as Fine-space Coordinates.

      Returns [FineCoord, FineCoord, FineCoord, FineCoord]

      local coord = osrs.ClientOp.coord()
      local topRight, topLeft, bottomRight, bottomLeft = coord:getFineCoordinateCorners()
      osrs.printf("Top Right - X: %d, y: %d, z: %d", topRight.x, topRight.y, topRight.z)
      osrs.printf("Top Left - X: %d, y: %d, z: %d", topLeft.x, topLeft.y, topLeft.z)
      osrs.printf("Bottom Right - X: %d, y: %d, z: %d", bottomRight.x, bottomRight.y, bottomRight.z)
      osrs.printf("Bottom Left - X: %d, y: %d, z: %d", bottomLeft.x, bottomLeft.y, bottomLeft.z)
    • returns a tile coordinate in the format of [level], [MapSquareX], [MapSquareZ], [TileX], [TileZ]

      Returns [number, number, number, number, number]

      -- Create new coord
      local coord = osrs.MapCoord.new(1, 10, 10)
      -- Get the map tile information of the coord
      local level, mapX, mapZ, tileX, tileZ = coord:getMapTile()
      -- Print all of the tile map info
      osrs.print(tostring(level))
      osrs.print(tostring(mapX))
      osrs.print(tostring(mapZ))
      osrs.print(tostring(tileX))
      osrs.print(tostring(tileZ))
    • Returns a new coordinate that is offset by the provided translation amount.

      Parameters

      • level: number

        the amount to move in the y-direction

      • x: number

        the amount to move in the x-direction

      • z: number

        the amount to move in the z-direction

      Returns MapCoord

      local activeTile = osrs.ClientOp.coord();
      osrs.ClientOp.highlightTileOn(activeTile:move(0,2,0):toBitPacked(), 6, true);
    • returns the coordinate of the player expressed as a single number, for use in legacy functions such as ClientOp.highlightTileOn.

      Returns number

      local activeTile = osrs.ClientOp.coord();
      osrs.ClientOp.highlightTileOn(activeTile:toBitPacked(), 6, true);
    • Creates a new Coord with the given coordinates.

      Parameters

      • level: number

        level value of the coordinates.

      • x: number

        value of the x-coordinate.

      • z: number

        value of the z-coordinate.

      Returns any

      -- Create a new Coord
      local coord = osrs.MapCoord.new(1, 10, 10)
    • Creates a new Coord with the given map tile coordinates.

      Parameters

      • level: number

        level value of the coordinates.

      • tileX1: number

        first value of the tile x-coordinate.

      • tileZ1: number

        first value of the tile z-coordinate.

      • tileX2: number

        second value of the tile x-coordinate.

      • tileZ2: number

        second value of the tile z-coordinate.

      Returns any

      -- Create a new Coord
      local coord = osrs.MapCoord.new(1, 59, 152, 35, 32)