Hierarchy (view full)

Constructors

Properties

emit: any
Routes: {
    AVOID_PRIVATE: {
        avoidPrivate: boolean;
        avoidPvp: boolean;
    };
    AVOID_PVP: {
        avoidPrivate: boolean;
        avoidPvp: boolean;
    };
    FASTEST: {
        avoidPrivate: boolean;
        avoidPvp: boolean;
    };
    SAFEST: {
        avoidPrivate: boolean;
        avoidPvp: boolean;
    };
} = Routes

Accessors

  • get lastLoc(): {
        x: number;
        z: number;
    }
  • Returns {
        x: number;
        z: number;
    }

    • x: number
    • z: number
  • set lastLoc(val): void
  • Parameters

    • val: {
          x: number;
          z: number;
      }
      • x: number
      • z: number

    Returns void

Methods

  • Gets the route to the destination, including the closest nation given what options allows.

    Parameters

    • loc: Point2D

      The coordinates of the destination.

    • options: {
          avoidPrivate: boolean;
          avoidPvp: boolean;
      } = Routes.SAFEST

      Whether we should avoid PVP and/or public nations.

      • avoidPrivate: boolean
      • avoidPvp: boolean

    Returns Promise<RouteInfo>

  • Parameters

    • playerName: string
    • interval: number = 3000
    • route: {
          avoidPrivate: boolean;
          avoidPvp: boolean;
      } = Routes.FASTEST
      • avoidPrivate: boolean
      • avoidPvp: boolean

    Returns Promise<GPS>

    Due to changes to the structure of the players endpoint, this method is likely to be broken or inaccurate and may be removed in future.
    It is suggested you implement tracking manually instead and use a 'best guess' system to determine whether the player is offline/underground etc.

  • Calculates the travel times (sec) for sneaking, walking, sprinting, and boating. Any decimals are truncated.
    If the input distance is negative, all of the times will be 0.

    Parameters

    • distance: number

      The amount of blocks to travel.

    Returns TravelTimes

  • Determines the direction to the destination from the origin.

    By default, all 8 directions are allowed, including intermediates such as North-East. To turn this off and only allow the 4 basic cardinal directions (North, East, South, West), you must pass false as the allowIntermediates argument.

    Parameters

    • origin: Point2D

      The location where something is currently at.

    • destination: Point2D

      The location we wish to arrive at.

    • allowIntermediates: boolean = true

    Returns
        | "North"
        | "East"
        | "South"
        | "West"
        | "North-East"
        | "South-East"
        | "South-West"
        | "North-West"