PrayerFinder

Methods to find and compare spell images


EPrayer

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

An enumeration representing different prayers in game.


TPrayerFinder

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 TPrayerFinder.Clean(image, template: TImage);

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

Example:

PrayerFinder.Clean(sourceImage, templateImage);

PrayerFinder.Setup

procedure TPrayerFinder.Setup();

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

Example:

PrayerFinder.Setup();

PrayerFinder.GetImage

function TPrayerFinder.GetImage(prayer: EPrayer): TImage;

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

Example:

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

PrayerFinder.FindAll

function TPrayerFinder.FindAll(prayers: array of EPrayer; boxes: TBoxArray; maxToFind: Integer = 0): TImageMatchArray;
function TPrayerFinder.FindAll(prayers: array of EPrayer; 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 TPrayerFinder.Find(prayers: array of EPrayer; boxes: TBoxArray; out match: TImageMatch): Boolean;

Finds the first match for specified prayers within given boxes.

Example:

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

PrayerFinder variable

Global TPrayerFinder variable.