# PrayerFinder Methods to find and compare spell images - - - ## ERSPrayer ```pascal 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 ```pascal procedure TRSPrayerFinder.Clean(image, template: TImage); ``` Cleans the template image by drawing its black-colored points. Example: ```pascal PrayerFinder.Clean(sourceImage, templateImage); ``` - - - ## PrayerFinder.Setup ```pascal procedure TRSPrayerFinder.Setup(); ``` Sets up the PrayerFinder, including cache management and similarity settings. Example: ```pascal PrayerFinder.Setup(); ``` - - - ## PrayerFinder.GetImage ```pascal function TRSPrayerFinder.GetImage(prayer: ERSPrayer): TImage; ``` Retrieves the image for a specific `prayer`, loading it from cache or extracting from ZIP if needed. Example: ```pascal img := PrayerFinder.GetImage(ERSPrayer.PIETY); img.Show(); ``` - - - ## PrayerFinder.FindAll ```pascal 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: ```pascal if PrayerFinder.FindAll(prayers, boxes, matches) then for match in matches do ShowOnTarget(matches.Box); ``` - - - ## PrayerFinder.Find ```pascal function TRSPrayerFinder.Find(prayers: array of ERSPrayer; boxes: TBoxArray; out match: TImageMatch): Boolean; ``` Finds the first match for specified `prayers` within given `boxes`. Example: ```pascal if PrayerFinder.Find([ERSPrayer.PIETY], boxes, match) then ShowOnTarget(match.Box); ``` - - - ## PrayerFinder variable Global {ref}`TRSPrayerFinder` variable.