# FairyRing Fairy rings interface. - - - ## FairyRing.Setup ```pascal procedure FairyRing.Setup(); ``` Initializes TFairyRing variables. ```{note} This is automatically called on the **FairyRing** variable. ``` - - - ## FairyRing.IsOpen ```pascal function TFairyRing.IsOpen(): Boolean; ``` Returns true/false whether the FairyRing interface is open or not. Example: ```pascal WriteLn FairyRing.IsOpen(); ``` - - - ## FairyRing.Close ```pascal function TFairyRing.Close(pressEscape: Boolean): Boolean; function TFairyRing.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 TFairyRing.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 TFairyRing.Open(): Boolean; ``` Attempts to open the closest fairy ring GameObject. Example: ```pascal WriteLn FairyRing.Open(); ``` - - - ## FairyRing.WalkOpen ```pascal function TFairyRing.WalkOpen(): Boolean; ``` Attempts to walk to if needed and open the closest fairy ring GameObject. Example: ```pascal WriteLn FairyRing.WalkOpen(); ``` - - - ## FairyRing.IsLetterValid ```pascal function TFairyRing.IsLetterValid(letter: Char; dial: EFairyRingDial): Boolean; ``` Checks if the **letter** passed on is valid for the given **dial**. Example: ```pascal WriteLn FairyRing.IsLetterValid('z', EFairyRingDial.LEFT); ``` - - - ## FairyRing.IsCodeValid ```pascal function TFairyRing.IsCodeValid(code: String): Boolean; ``` Checks if the a given **code** is a valid fairy ring code. Example: ```pascal WriteLn FairyRing.IsCodeValid('abc'); ``` - - - ## FairyRing.GetLetterBox ```pascal function TFairyRing.GetLetterBox(dial: EFairyRingDial): TBox; ``` Returns the current letter box of a fairy ring dial. Example: ```pascal Debug(FairyRing.GetLetterBox(EFairyRingDial.MIDDLE)); ``` - - - ## FairyRing.GetLetter ```pascal function TFairyRing.GetLetter(dial: EFairyRingDial): Char; ``` Returns the letter of a fairy ring dial. Example: ```pascal WriteLn FairyRing.GetLetter(EFairyRingDial.RIGHT); ``` - - - ## FairyRing.GetCurrentCode ```pascal function TFairyRing.GetCurrentCode(): String; ``` Returns the full current fairy ring code set in the dials. Example: ```pascal WriteLn FairyRing.GetCurrentCode(); ``` - - - ## FairyRing.GetRotationBox ```pascal function TFairyRing.GetLeftRotationBox(dial: EFairyRingDial): TBox; function TFairyRing.GetRightRotationBox(dial: EFairyRingDial): TBox; ``` Returns the left or right rotation box of the given **dial**. Example: ```pascal Debug(FairyRing.GetLeftRotationBox(EFairyRingDial.LEFT)); ``` - - - ## FairyRing.Spin ```pascal function TFairyRing.SpinLeft(dial: EFairyRingDial; skipWait: Boolean = False): Boolean; function TFairyRing.SpinRight(dial: EFairyRingDial; 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(EFairyRingDial.LEFT); ``` - - - ## FairyRing.SetDial ```pascal function TFairyRing.SetDial(letter: Char; dial: EFairyRingDial; skipWait: Boolean = False): Boolean; ``` Spins the dial so that the current selected letter is the specified one. Example: ```pascal WriteLn FairyRing.SetDial('c', EFairyRingDial.LEFT); ``` - - - ## FairyRing.DialCode ```pascal function TFairyRing.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 TFairyRing.GetTeleportButton(): TBox; ``` Returns the box of the teleport button. Example: ```pascal Debug(FairyRing.GetTeleportButton()); ``` - - - ## FairyRing.ClickTeleportButton ```pascal function TFairyRing.ClickTeleportButton(): Boolean; ``` Clicks the fairy ring the teleport button. Example: ```pascal WriteLn FairyRing.ClickTeleportButton(); ``` - - - ## FairyRing.GetLogCodes ```pascal function TFairyRing.GetLogCodes(out boxes: TBoxArray): TStringArray; function TFairyRing.GetLogCodes(): TStringArray; overload; ``` Returns the visible codes in the fairy ring travel log. Example: ```pascal WriteLn FairyRing.GetLogCodes(); ``` - - - ## FairyRing.FindLogCode ```pascal function TFairyRing.FindLogCode(code: String; out b: TBox): Boolean; function TFairyRing.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 TFairyRing.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 TFairyRing.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 TFairyRing.Teleport(code: String): Boolean; ``` Teleports the user to the specified fairy ring code. If the fairy ring interface is not open, the **GameObject** 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 TFairyRing.WalkTeleport(code: String): Boolean; ``` Teleports the user to the specified fairy ring code. If the fairy ring interface is not open, the **GameObject** 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.