# Prayer Methods to interact with the prayer tab and quick prayers. - - - ## Prayer.Setup ```pascal procedure TRSPrayer.Setup; override; ``` Initializes **Prayer** variables. ```{note} This is automatically called on the **Prayer** variable. ``` - - - ## Prayer.SetupAlignment ```pascal procedure TRSPrayer.SetupAlignment(Mode: ERSClientMode); override; ``` Setups up the interface aligment for the current client mode. ```{note} This is automatically called on the **TRSClient.ClientModeChanged** function. ``` - - - ## Prayer.GetPrayerLevel ```pascal function TRSPrayer.GetPrayerLevel(): Int32; ``` **Prayer.GetPrayerLevel** is used to retrieve the prayer level from the prayer tab. Example: ```pascal Writeln Prayer.GetPrayerLevel(); ``` - - - ## Prayer.IsOpen ```pascal function TRSPrayer.IsOpen(): Boolean; ``` Returns true if the Prayer tab is open. - - - ## Prayer.Open ```pascal function TRSPrayer.Open(): Boolean; ``` Attempts to open the prayer tab. Example: ```pascal Prayer.Open; ``` - - - ## Prayer.GetPrayerBoxes ```pascal function TRSPrayer.GetPrayerBoxes(): TBoxArray; ``` ```pascal function TRSPrayer.GetPrayerBoxes(Prayers: array of ERSPrayer): TBoxArray; overload; ``` Internal function to get the bounds of all or the specified prayers. - - - ## Prayer.GetPrayerBox ```pascal function TRSPrayer.GetPrayerBox(Prayer: ERSPrayer): TBox; ``` Internal function to get the bounds of a single prayer. - - - ## Prayer.PointToPrayer ```pascal function TRSPrayer.PointToPrayer(P: TPoint): Int32; ``` Returns the prayer number that **P** is part of. -1 is returned if there's no result. Example: ```pascal WriteLn('Mouse is hovering prayer ', Prayer.PointToPrayer(Mouse.Position)); ``` - - - ## Prayer.MouseOver ```pascal function TRSPrayer.MouseOver(Prayer: ERSPrayer): Boolean; ``` Hovers the specified prayer. Example: ```pascal Prayer.MouseOver(ERSPrayer.PROTECT_FROM_MELEE); ``` - - - ## Prayer.CanActivate ```pascal function TRSPrayer.CanActivate(Prayer: ERSPrayer): Boolean; ``` Returns true if we have enough level and have unlocked the specified prayer. Example: ```pascal WriteLn Prayer.CanActivate(ERSPrayer.PROTECT_FROM_MELEE); ``` - - - ## Prayer.GetAvailablePrayers ```pascal function TRSPrayer.GetAvailablePrayers: array of ERSPrayer; ``` Returns an array of all available prayers. - - - ## Prayer.IsPrayerActive ```pascal function TRSPrayer.IsPrayerActive(Prayer: ERSPrayer): Boolean; ``` Returns true if the specified prayer is active right now. Example: ```pascal WriteLn Prayer.IsPrayerActive(ERSPrayer.SMITE); ``` - - - ## Prayer.AnyPrayerActive() ```pascal function TRSPrayer.AnyPrayerActive(prayers: array of ERSPrayer): Boolean; ``` Returns true if any of the specified prayers is active. - - - ## Prayer.AllPrayerActive ```pascal function TRSPrayer.AllPrayerActive(prayers: array of ERSPrayer): Boolean; ``` Returns true if all of the specified prayers is active. - - - ## Prayer.GetActivePrayers ```pascal function TRSPrayer.GetActivePrayers: array of ERSPrayer; ``` Returns an array of all active prayers. - - - ## Prayer.PrayerActive ```pascal function TRSPrayer.PrayerActive: Boolean; ``` Returns true if any prayer is active. - - - ## Prayer.ActivatePrayer ```pascal function TRSPrayer.ActivatePrayer(prayers: array of ERSPrayer): Boolean; function TRSPrayer.ActivatePrayer(prayer: ERSPrayer): Boolean; overload; ``` Attempts to activate the specified `prayer`or `prayers`. Example: ```pascal Prayer.ActivatePrayer(ERSPrayer.PROTECT_FROM_MELEE); ``` - - - ## Prayer.DisablePrayer ```pascal function TRSPrayer.DisablePrayer(prayers: array of ERSPrayer): Boolean; function TRSPrayer.DisablePrayer(prayer: ERSPrayer): Boolean; overload; ``` Attempts to disable the specified `prayer` or `prayers`. Example: ```pascal Prayer.DisablePrayer(ERSPrayer.PROTECT_FROM_MELEE); ``` - - - ## var Prayer Global Prayer variable. - - - ## QuickPrayer.Setup ```pascal procedure QuickPrayer.Setup; ``` Initializes **QuickPrayer** variables. ```{note} This is automatically called on the **QuickPrayer** variable. ``` - - - ## QuickPrayer.SetupSetupAlignment ```pascal procedure QuickPrayer.SetupSetupAlignment(Mode: ERSClientMode); override; ``` Setups up the interface aligment for the current client mode. ```{note} This is automatically called on the **TRSClient.ClientModeChanged** function. ``` - - - ## QuickPrayer.IsOpen ```pascal function QuickPrayer.IsOpen(): Boolean; function QuickPrayer.IsOpen(waitTime: Int32; interval: Int32 = -1): Boolean; overload; ``` Returns true if the quick prayers are open. - - - ## QuickPrayer.Open ```pascal function QuickPrayer.Open(): Boolean; ``` Attempts to open the quick prayers. Example: ```pascal QuickPrayer.Open(); ``` - - - ## QuickPrayer.GetButton ```pascal function QuickPrayer.GetButton(): TBox; ``` Internal function that returns the bounds of the quick prayers close button. - - - ## QuickPrayer.Close ```pascal function QuickPrayer.Close(): Boolean; ``` Attempts to close the quick prayers. Example: ```pascal QuickPrayers.Close; ``` - - - ## QuickPrayer.IsPrayerSelected ```pascal function QuickPrayer.IsPrayerSelected(qPrayer: ERSPrayer): Boolean; ``` Returns true if the specified quick prayer is selected. Example: ```pascal WriteLn QuickPrayers.IsPrayerSelected(ERSPrayer.PROTECT_FROM_MAGIC); ``` - - - ## QuickPrayer.GetSelectedPrayers ```pascal function QuickPrayer.GetSelectedPrayers(): array of ERSPrayer; ``` Returns an array of all selected quick prayers Example: ```pascal WriteLn QuickPrayers.GetSelectedPrayers; ``` - - - ## QuickPrayer.SelectPrayer ```pascal function QuickPrayer.SelectPrayer(QPrayer: ERSPrayer): Boolean; function QuickPrayer.SelectPrayer(QPrayers: array of ERSPrayer): Boolean; overload; ``` Attempts to select the specified quick prayer/prayers. Example: ```pascal QuickPrayers.SelectPrayer(ERSPrayer.PROTECT_ITEM); ``` - - - ## QuickPrayer.DeselectPrayer ```pascal function QuickPrayer.DeselectPrayer(QPrayer: ERSPrayer): Boolean; function QuickPrayer.DeselectPrayer(QPrayers: array of ERSPrayer): Boolean; overload; ``` Attempts to Deselect the specified quick prayer/prayers. Example: ```pascal QuickPrayers.DeselectPrayer(ERSPrayer.PROTECT_ITEM); ``` - - - ## var QuickPrayer Global QuickPrayer variable. - - - ## Prayer.Open() override ```pascal function TRSPrayer.Open: Boolean; override; ``` Overrides **Prayer.Open** to handle quick prayers if they are open. - - - ## Prayer.CanActivate() override ```pascal function TRSPrayer.CanActivate(Prayer: ERSPrayer): Boolean; override; ``` Overrides `Prayer.CanActivate()` to handle quick prayers. - - - ## Prayer.GetAvailablePrayers() override ```pascal function TRSPrayer.GetAvailablePrayers(): array of ERSPrayer; override; ``` Overrides `Prayer.GetAvailablePrayers()` to handle quick prayers.