# FairyRing Fairy rings interface. - - - ## FairyRing.Setup ```pascal procedure FairyRing.Setup(); ``` Initializes TRSFairyRing variables. ```{note} This is automatically called on the **FairyRing** variable. ``` - - - ## FairyRing.IsOpen ```pascal function TRSFairyRing.IsOpen(): Boolean; ``` Returns true/false whether the FairyRing interface is open or not. Example: ```pascal WriteLn FairyRing.IsOpen(); ``` - - - ## FairyRing.Close ```pascal function TRSFairyRing.Close(pressEscape: Boolean): Boolean; function TRSFairyRing.Close(chance: Double = BioHash): Boolean; overload; ``` Closes the FairyRing interface, depending on `pressEscape` the function will either click the button or press escape. Example: ```pascal WriteLn FairyRing.Close(); ``` - - - ## FairyRing.HandleItem ```pascal function TRSFairyRing.HandleItem(): Boolean; ``` Magically finds, caches for next usages and equips dramen or lunar staff with the minimum tab opening possible. If no item is found, we will assume the user has the elite lumbridge and draynor diary complete for next uses. Example: ```pascal if FairyRing.HandleItem() then WriteLn FairyRing.Item; ``` - - - ## FairyRing.Open ```pascal function TRSFairyRing.Open(): Boolean; ``` Attempts to open the closest fairy ring RSObject. Example: ```pascal WriteLn FairyRing.Open(); ``` - - - ## FairyRing.WalkOpen ```pascal function TRSFairyRing.WalkOpen(): Boolean; ``` Attempts to walk to if needed and open the closest fairy ring RSObject. Example: ```pascal WriteLn FairyRing.WalkOpen(); ``` - - - ## FairyRing.IsLetterValid ```pascal function TRSFairyRing.IsLetterValid(letter: Char; dial: ERSFairyRingDial): Boolean; ``` Checks if the **letter** passed on is valid for the given **dial**. Example: ```pascal WriteLn FairyRing.IsLetterValid('z', ERSFairyRingDial.LEFT); ``` - - - ## FairyRing.IsCodeValid ```pascal function TRSFairyRing.IsCodeValid(code: String): Boolean; ``` Checks if the a given **code** is a valid fairy ring code. Example: ```pascal WriteLn FairyRing.IsCodeValid('abc'); ``` - - - ## FairyRing.GetDials ```pascal function TRSFairyRing.GetDials(): TBoxArray; ``` Returns the fairy ring dials boxes Example: ```pascal Debug(FairyRing.GetDials()); ``` - - - ## FairyRing.GetDial ```pascal function TRSFairyRing.GetDial(dial: ERSFairyRingDial): TBox; ``` Returns the box of a fairy ring dial. Example: ```pascal Debug(FairyRing.GetDial(ERSFairyRingDial.MIDDLE)); ``` - - - ## FairyRing.GetLetterBox ```pascal function TRSFairyRing.GetLetterBox(dial: ERSFairyRingDial): TBox; ``` Returns the current letter box of a fairy ring dial. Example: ```pascal Debug(FairyRing.GetLetterBox(ERSFairyRingDial.MIDDLE)); ``` - - - ## FairyRing.GetLetter ```pascal function TRSFairyRing.GetLetter(dial: ERSFairyRingDial): Char; ``` Returns the letter of a fairy ring dial. Example: ```pascal WriteLn FairyRing.GetLetter(ERSFairyRingDial.RIGHT); ``` - - - ## FairyRing.GetCurrentCode ```pascal function TRSFairyRing.GetCurrentCode(): String; ``` Returns the full current fairy ring code set in the dials. Example: ```pascal WriteLn FairyRing.GetCurrentCode(); ``` - - - ## FairyRing.GetRotationBox ```pascal function TRSFairyRing.GetLeftRotationBox(dial: ERSFairyRingDial): TBox; function TRSFairyRing.GetRightRotationBox(dial: ERSFairyRingDial): TBox; ``` Returns the left or right rotation box of the given **dial**. Example: ```pascal Debug(FairyRing.GetLeftRotationBox(ERSFairyRingDial.LEFT)); ``` - - - ## FairyRing.Spin ```pascal function TRSFairyRing.SpinLeft(dial: ERSFairyRingDial; skipWait: Boolean = False): Boolean; function TRSFairyRing.SpinRight(dial: ERSFairyRingDial; skipWait: Boolean = False): Boolean; ``` Spins the given **dial** left or right. By default it waits for the rotation to finish but it can be skipped with **skipWait**. Example: ```pascal WriteLn FairyRing.SpinLeft(ERSFairyRingDial.LEFT); ``` - - - ## FairyRing.SetDial ```pascal function TRSFairyRing.SetDial(letter: Char; dial: ERSFairyRingDial; skipWait: Boolean = False): Boolean; ``` Spins the dial so that the current selected letter is the specified one. Example: ```pascal WriteLn FairyRing.SetDial('c', ERSFairyRingDial.LEFT); ``` - - - ## FairyRing.DialCode ```pascal function TRSFairyRing.DialCode(code: String; attempts: Int32 = 3): Boolean; ``` Dials in a full code on the fairy ring. Codes casing is ignored. **attempts** is a helper parameter and shouldn't be touched if you don't know what you are doing. Example: ```pascal WriteLn FairyRing.DialCode('cip'); ``` - - - ## FairyRing.GetTeleportButton ```pascal function TRSFairyRing.GetTeleportButton(): TBox; ``` Returns the box of the teleport button. Example: ```pascal Debug(FairyRing.GetTeleportButton()); ``` - - - ## FairyRing.ClickTeleportButton ```pascal function TRSFairyRing.ClickTeleportButton(): Boolean; ``` Clicks the fairy ring the teleport button. Example: ```pascal WriteLn FairyRing.ClickTeleportButton(); ``` - - - ## FairyRing.GetLogCodes ```pascal function TRSFairyRing.GetLogCodes(out boxes: TBoxArray): TStringArray; function TRSFairyRing.GetLogCodes(): TStringArray; overload; ``` Returns the visible codes in the fairy ring travel log. Example: ```pascal WriteLn FairyRing.GetLogCodes(); ``` - - - ## FairyRing.FindLogCode ```pascal function TRSFairyRing.FindLogCode(code: String; out b: TBox): Boolean; function TRSFairyRing.FindLogCode(code: String): Boolean; overload; ``` Finds the code specified in the travel log. Codes casing is ignored. Example: ```pascal WriteLn FairyRing.FindLogCode('cip'); ``` - - - ## FairyRing.ClickLogCode ```pascal function TRSFairyRing.ClickLogCode(code: String): Boolean; ``` Finds and clicks the code specified in the travel log. Codes casing is ignored. Example: ```pascal WriteLn FairyRing.ClickLogCode('cip'); ``` - - - ## FairyRing.HandleInterface ```pascal function TRSFairyRing.HandleInterface(code: String): Boolean; ``` Completely handles the fairy ring interface to set a code and teleport. Will use both the log and the dials depending on the user biohash. Example: ```pascal WriteLn FairyRing.HandleInterface('cip'); ``` - - - ## FairyRing.Teleport ```pascal function TRSFairyRing.Teleport(code: String): Boolean; ``` Teleports the user to the specified fairy ring code. If the fairy ring interface is not open, the **RSObject** will be used to find the closest one and open it. If the code is on the right click context menu, it will be used. You can also optional pass in "Zanaris" or "BKS" to go to zanaris. Example: ```pascal WriteLn FairyRing.Teleport('cip'); ``` - - - ## FairyRing.WalkTeleport ```pascal function TRSFairyRing.WalkTeleport(code: String): Boolean; ``` Teleports the user to the specified fairy ring code. If the fairy ring interface is not open, the **RSObject** will be used to find the closest one and open it. If the fairy ring is not visible, we will walk to it. If the code is on the right click context menu, it will be used. You can also optional pass in "Zanaris" or "BKS" to go to zanaris. Example: ```pascal WriteLn FairyRing.Teleport('cip'); ``` - - - ## var FairyRing Global FairyRing variable.