# Prayer Methods to interact with the prayer gametab. ```{figure} ../../images/prayer.png ``` - - - ## TRSPrayerSet A set of prayers represented by the `ERSPrayer` enumeration. - - - ## TRSPrayer Main record used to interact with the {ref}`Prayer` gametab. - - - ## TRSPrayer.Slots ```pascal Slots: TBoxArray; ``` Slot boxes of the prayers. You are unlikely to need to use these directly. Example: ```pascal ShowOnTarget(Prayer.Slots); ``` ```{figure} ../../images/prayer_slots.png ``` - - - ## Prayer.SetupGameTab ```pascal procedure TRSPrayer.SetupGameTab(); ``` Internal method used to setup the {ref}`TRSPrayer` coordinates. This is automatically called for you on the {ref}`Prayer variable`. - - - ## TRSPrayer.IsOpen ```pascal function TRSPrayer.IsOpen(): Boolean; ``` Returns True/False whether the {ref}`Prayer` gametab is currently open. Example: ```pascal if Prayer.IsOpen() then WriteLn('Prayer tab is open') else WriteLn('Prayer tab is closed'); ``` - - - ## Prayer.Open ```pascal function TRSPrayer.Open(): Boolean; ``` Attempts to open the Prayer tab. Example: ```pascal if Prayer.Open() then WriteLn('Prayer tab is open') else WriteLn('Failed to open Prayer tab'); ``` - - - ## Prayer.GetInfoBox ```pascal function TRSPrayer.GetInfoBox(): TBox; ``` Attempts to locate and return the bounding box of the yellow prayer info box (the tooltip). Example: ```pascal ShowOnTarget(Prayer.GetInfoBox()); ``` ```{figure} ../../images/prayer_tooltip.png ``` - - - ## Prayer.InfoIsOpen ```pascal function TRSPrayer.InfoIsOpen(): Boolean; ``` Returns True/False if the yellow prayer info box (the tooltip) is currently open. Example: ```pascal WriteLn Prayer.InfoIsOpen(); ``` - - - ## Prayer.CloseInfo ```pascal function TRSPrayer.CloseInfo(): Boolean; ``` Attempts to close the prayer info box if it is open. Example: ```pascal WriteLn Prayer.CloseInfo(); ``` - - - ## Prayer.Find ```pascal function TRSPrayer.Find(prayer: ERSPrayer; out bounds: TBox; attempts: Integer = 2): Boolean; ``` Searches for the specified `prayer`. Returns true if found and it's bounds through `bounds` Example: ```pascal WriteLn Prayer.Find(ERSPrayer.Smite, b); ``` - - - ## Prayer.Hover ```pascal function TRSPrayer.Hover(prayer: ERSPrayer; checkUpText: Boolean = False): Boolean; ``` Moves the mouse over the specified `prayer`. Example: ```pascal WriteLn Prayer.Hover(ERSPrayer.PIETY); ``` - - - ## Prayer.Click ```pascal function TRSPrayer.Click(prayer: ERSPrayer; button: EMouseButton = EMouseButton.LEFT; checkUpText: Boolean = False): Boolean; ``` Clicks on the specified `prayer` with the specified `button`. If no `button` is specified `EMouseButton.LEFT` is used. Example: ```pascal Prayer.Click(ERSPrayer.PIETY); ``` - - - ## Prayer.CanActivate ```pascal function TRSPrayer.CanActivate(prayer: ERSPrayer): Boolean; ``` Checks if the specified prayer can be activated. For example, if you check a prayer you don't have the level for this should return `False`. Example: ```pascal WriteLn Prayer.CanActivate(ERSPrayer.PIETY); ``` - - - ## Prayer.IsActive ```pascal function TRSPrayer.IsActive(prayers: TRSPrayerSet): Boolean; overload; ``` Returns true if all the specified `prayers` are currently active. Example: ```pascal if Prayer.IsActive([ERSPrayer.PIETY, ERSPrayer.PROTECT_FROM_MELEE]) then WriteLn('Both prayers are active') else WriteLn('One or more prayers are not active'); ``` - - - ## Prayer.GetActivePrayers ```pascal function TRSPrayer.GetActivePrayers(): TRSPrayerSet; ``` Returns a set of all currently active prayers. Example: ```pascal WriteLn(Prayer.GetActivePrayers()); ``` - - - ## Prayer.Activate ```pascal function TRSPrayer.Activate(prayers: TRSPrayerSet): Boolean; ``` Attempts to activate all the specified `prayers`. Example: ```pascal if Prayer.Activate([ERSPrayer.PIETY, ERSPrayer.PROTECT_FROM_MELEE]) then WriteLn('Prayers activated successfully') else WriteLn('Failed to activate prayers'); ``` - - - ## Prayer.Deactivate ```pascal function TRSPrayer.Deactivate(prayers: TRSPrayerSet): Boolean; ``` Attempts to deactivate all the specified `prayers`. Example: ```pascal if Prayer.Deactivate([ERSPrayer.PIETY, ERSPrayer.PROTECT_FROM_MELEE]) then WriteLn('Prayers deactivated successfully') else WriteLn('Failed to deactivate prayers'); ``` - - - ## Prayer variable Global {ref}`TRSPrayer` variable.