RSTranslator

This file is responsible for conversions or internal RuneScape values to values that can be used by Simba and back.


type TRSTranslator

type
  TRSTranslator = record
    TileSize, TileArea, MaxHeight, Planes: UInt32;

    RSMap, Map: record
      ChunkSide: UInt32;
      Dimensions: TPoint;
      Scope: TBox;
    end;
  end;

This file is responsible for conversions or internal RuneScape values to values that can be used by Simba and back.


RSTranslator.Setup

procedure TRSTranslator.Setup();

Internal method automatically called when a script runs. This sets up variables for that the TRSTranslator relies on.


RSTranslator.RSWidth

function TRSTranslator.RSWidth(): Int32; constref;

Returns the full width in “chunks” of the OldSchool RuneScape map.

Example:

WriteLn RSTranslator.RSWidth();

RSTranslator.RSHeight

function TRSTranslator.RSHeight(): Int32; constref;

Returns the full height in “chunks” of the OldSchool RuneScape map.

Example:

WriteLn RSTranslator.RSWidth();

RSTranslator.MapWidth

function TRSTranslator.MapWidth(): UInt32; constref;

Returns the full width in pixels of the OldSchool RuneScape map.

Example:

WriteLn RSTranslator.MapWidth();

RSTranslator.MapHeight

function TRSTranslator.MapHeight(): Int32; constref;

Returns the full height in pixels of the OldSchool RuneScape map.

Example:

WriteLn RSTranslator.MapHeight();

RSTranslator.RSArea

function TRSTranslator.RSArea(): UInt32; constref;

Returns the area of the OldSchool RuneScape map measured in chunks.

Example:

WriteLn RSTranslator.RSArea();

RSTranslator.MapArea

function TRSTranslator.MapArea(): UInt32; constref;

Returns the area of the OldSchool RuneScape map measured in pixels.

Example:

WriteLn RSTranslator.MapArea();

RSTranslator.RSCoordinate2Chunk

function TRSTranslator.RSCoordinate2Chunk(p: TPoint): TPoint;

Returns the chunk number or a RuneScape coordinate as a TPoint.

Example:

WriteLn RSTranslator.RSCoordinate2Chunk(Point(2000, 2000));

RSTranslator.Global2Chunk

function TRSTranslator.Global2Chunk(p: TPoint): TPoint;
function TRSTranslator.Global2Chunk(b: TBox): TBox; overload;

Converts a “Global” coordinate to a chunk number.

Example:

WriteLn RSTranslator.Global2Chunk(Point(2000, 2000));

RSTranslator.Chunk2RSCoordinate

function TRSTranslator.Chunk2RSCoordinate(p: TPoint): TPoint;

Converts a “Chunk” number to the top left RS coordinate of that chunk.

Example:

WriteLn RSTranslator.Chunk2RSCoordinate(Point(53, 50));

RSTranslator.Chunk2Coordinate

function TRSTranslator.Chunk2Coordinate(p: TPoint): TPoint;
function TRSTranslator.Chunk2Coordinate(b: TBox): TBox; overload;

Converts a “Chunk” number to the top left “Global” coordinate of that chunk.

Example:

WriteLn RSTranslator.Chunk2Coordinate(Point(53, 50));

RSTranslator.Coordinate2RSCoordinate

function TRSTranslator.Coordinate2RSCoordinate(p: TPoint): TPoint;

Converts a “Global” coordinate into a “RuneScape” coordinate.

Example:

WriteLn RSTranslator.Coordinate2RSCoordinate(Point(4000, 35000));

RSTranslator.RSCoordinate2Coordinate

function TRSTranslator.RSCoordinate2Coordinate(p: TPoint): TPoint;

Converts a “RuneScape” coordinate into a “Global” coordinate.

Example:

WriteLn RSTranslator.RSCoordinate2Coordinate(Point(2000, 2000));