# Prayer Methods to interact with the prayer gametab. ```{figure} ../../images/prayer.png ``` - - - ## TPrayerSet A set of prayers represented by the `EPrayer` enumeration. - - - ## TPrayer Main record used to interact with the {ref}`Prayer` gametab. - - - ## TPrayer.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 TPrayer.SetupGameTab(); ``` Internal method used to setup the {ref}`TPrayer` coordinates. This is automatically called for you on the {ref}`Prayer variable`. - - - ## TPrayer.IsOpen ```pascal function TPrayer.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 TPrayer.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 TPrayer.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 TPrayer.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 TPrayer.CloseInfo(): Boolean; ``` Attempts to close the prayer info box if it is open. Example: ```pascal WriteLn Prayer.CloseInfo(); ``` - - - ## Prayer.Find ```pascal function TPrayer.Find(prayer: EPrayer; 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(EPrayer.Smite, b); ``` - - - ## Prayer.Hover ```pascal function TPrayer.Hover(prayer: EPrayer; checkUpText: Boolean = False): Boolean; ``` Moves the mouse over the specified `prayer`. Example: ```pascal WriteLn Prayer.Hover(EPrayer.PIETY); ``` - - - ## Prayer.Click ```pascal function TPrayer.Click(prayer: EPrayer; 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(EPrayer.PIETY); ``` - - - ## Prayer.CanActivate ```pascal function TPrayer.CanActivate(prayer: EPrayer): 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(EPrayer.PIETY); ``` - - - ## Prayer.IsActive ```pascal function TPrayer.IsActive(prayers: TPrayerSet): Boolean; overload; ``` Returns true if all the specified `prayers` are currently active. Example: ```pascal if Prayer.IsActive([EPrayer.PIETY, EPrayer.PROTECT_FROM_MELEE]) then WriteLn('Both prayers are active') else WriteLn('One or more prayers are not active'); ``` - - - ## Prayer.GetActivePrayers ```pascal function TPrayer.GetActivePrayers(): TPrayerSet; ``` Returns a set of all currently active prayers. Example: ```pascal WriteLn(Prayer.GetActivePrayers()); ``` - - - ## Prayer.Activate ```pascal function TPrayer.Activate(prayers: TPrayerSet): Boolean; ``` Attempts to activate all the specified `prayers`. Example: ```pascal if Prayer.Activate([EPrayer.PIETY, EPrayer.PROTECT_FROM_MELEE]) then WriteLn('Prayers activated successfully') else WriteLn('Failed to activate prayers'); ``` - - - ## Prayer.Deactivate ```pascal function TPrayer.Deactivate(prayers: TPrayerSet): Boolean; ``` Attempts to deactivate all the specified `prayers`. Example: ```pascal if Prayer.Deactivate([EPrayer.PIETY, EPrayer.PROTECT_FROM_MELEE]) then WriteLn('Prayers deactivated successfully') else WriteLn('Failed to deactivate prayers'); ``` - - - ## Prayer variable Global {ref}`TPrayer` variable.