PrayerFinder

Methods to find and compare spell images


ERSPrayer

ERSPrayer = enum(UNKNOWN, THICK_SKIN..PIETY, RIGOUR, AUGURY);

An enumeration representing different prayers in RuneScape.


TRSPrayerFinder

A record for finding and managing prayer images.

Fields:

  • PrayerImages: Stores images for each prayer type

  • Version: Stores the version hash of the image set

  • Similarity: Threshold for image comparison

  • ImageCompare: Utility for comparing images

  • CacheDir: Directory for storing cached prayer images

  • ZIP: Path to the zip file containing prayer images


PrayerFinder.Clean

procedure TRSPrayerFinder.Clean(image, template: TImage);

Cleans the template image by drawing its black-colored points.

Example:

PrayerFinder.Clean(sourceImage, templateImage);

PrayerFinder.Setup

procedure TRSPrayerFinder.Setup();

Sets up the PrayerFinder, including cache management and similarity settings.

Example:

PrayerFinder.Setup();

PrayerFinder.GetImage

function TRSPrayerFinder.GetImage(prayer: ERSPrayer): TImage;

Retrieves the image for a specific prayer, loading it from cache or extracting from ZIP if needed.

Example:

img := PrayerFinder.GetImage(ERSPrayer.PIETY);
img.Show();

PrayerFinder.FindAll

function TRSPrayerFinder.FindAll(prayers: array of ERSPrayer; boxes: TBoxArray; maxToFind: Integer = 0): TImageMatchArray;
function TRSPrayerFinder.FindAll(prayers: array of ERSPrayer; boxes: TBoxArray; out matches: TImageMatchArray): Boolean; overload;

Finds matches for specified prayers within given boxes.

Example:

if PrayerFinder.FindAll(prayers, boxes, matches) then
  for match in matches do
    ShowOnTarget(matches.Box);

PrayerFinder.Find

function TRSPrayerFinder.Find(prayers: array of ERSPrayer; boxes: TBoxArray; out match: TImageMatch): Boolean;

Finds the first match for specified prayers within given boxes.

Example:

if PrayerFinder.Find([ERSPrayer.PIETY], boxes, match) then
  ShowOnTarget(match.Box);

PrayerFinder variable

Global TRSPrayerFinder variable.