WalkerMap

This file contains internal methods used by walker.


TWalkerRegions

  TWalkerRegions = record
    WORLD:          TBox;
    ZEAH:           TBox;
    EDGEVILLE:      TBox;
    VARROCK:        TBox;
    GRAND_EXCHANGE: TBox;
    LUNAR_ISLE:     TBox;
    LUMBRIDGE:      TBox;
    ISLE_OF_SOULS:  TBox;
  end;

Collection of pre-made boxes that can be used in TWalker.Setup();


RSWalkerLocations

Collection of pre-made coordinates that can be used in TWalker;


type TWalkerMap

TWalkerMap is the record responsible for handling map loading for TWalker and keep track of regions if there’s any.


TWalkerMap.FindMap

function TWalkerMap.FindMap(Map: String): String; static;

Internal function responsible for finding our map. If the Map is a path and it exists the function exits. Otherwise, it looks for a .png and .bmp file with the map name in Simba/Includes/osr/walker/maps and returns the file path. You probably will never need to use this directly but if you want to debug things consider the following example.

Example:

WriteLn TWalkerMap.FindMap('world');

TWalkerMap.InternalLoadMap

function TWalkerMap.InternalLoadMap(fileName: String; Region: TBox = []): TMufasaBitmap; static;

Internal function responsible for loading our map. If a “Region” is specified, that region is cropped from the the image file and returned, otherwise the whole file is returned as a TMufasaBitmap. You probably will never need to use this directly, but consider the following example for debugging purposes.

Example:

TWalkerMap.InternalLoadMap('world', RSWalkerRegions.GRAND_EXCHANGE).Debug();

TWalkerMap.Free

procedure TWalkerMap.Free();

Internal function responsible for releasing TWalkerMap from memory. You probably will never need to use this directly. It’s automatically called on script termination.


TWalkerMap.Load

procedure TWalkerMap.Load(fileName: String; scaling: Int32); overload;
procedure TWalkerMap.Load(fileName: String; aRegions: TBoxArray; scaling: Int32; Padding: Int32 = 50); overload;
procedure TWalkerMap.Load(fileName: String; aRegion: TBox; scaling: Int32; padding: Int32 = 50); overload;
procedure TWalkerMap.Load(fileName: String; start: TPoint; scaling: Int32; out aRegion: TBox; padding: Int32 = 50); overload;

Internal function responsible for setting up TWalkerMap. This is where we load our bitmaps and store them in a TWalkerMap variable. It’s also where we downsample our map for faster searches. TWalkerMap.Map contains the full sized map image while TWalkerMap.ScaledMap contains the downsampled map. You probably will never need to use this directly but consider the following example for debugging purposes.

Example:

var
  map: TWalkerMap;
begin
  map.Load('world', 8);
  map.Map.Debug();
  Wait(4000);
  map.ScaledMap.Debug();
end;

TWalkerMap.RegionIndexFromPoint

function TWalkerMap.RegionIndexFromPoint(P: TPoint): Int32;

Internal TWalkerMap function used to return the region p belongs to. You probably don’t need to ever call this but can be useful for debugging.


TWalkerMap.RegionToGlobal

function TWalkerMap.RegionToGlobal(p: TPoint): TPoint;

Internal TWalkerMap function used to convert a region point p to a global point. This is responsible for converting WalkerMap region point to the coordinates of that same point in the original map file the regions were cropped from. You probably don’t need to ever call this but can be useful for debugging.


TWalkerMap.GlobalToRegion

function TWalkerMap.GlobalToRegion(RegionIndex: Int32; P: TPoint): TPoint;

Internal TWalkerMap function used to convert a global point p to a region point. This is literally the inverse of TWalkerMap.RegionToGlobal(). You probably don’t need to ever call this but can be useful for debugging.