FairyRing¶
Methods to interact with the Fairy rings interface:
EFairyRingDial¶
EFairyRingDial = enum(LEFT, MIDDLE, RIGHT);
Enum representing the FairyRing dials available.
TFairyRing¶
Record responsible with interacting with the FairyRing.
FairyRing.Setup¶
procedure FairyRing.Setup();
Initializes TFairyRing variables.
Note
This is automatically called on the FairyRing variable.
FairyRing.IsOpen¶
function TFairyRing.IsOpen(): Boolean;
Returns true/false whether the FairyRing interface is open or not.
Example:
WriteLn FairyRing.IsOpen();
FairyRing.WaitOpen¶
function TFairyRing.WaitOpen(time: Integer; interval: Integer = -1): Boolean;
Returns true if the fairy ring interface is open within time milliseconds.
Example:
WriteLn FairyRing.WaitOpen();
FairyRing.Close¶
function TFairyRing.Close(escape: Boolean): Boolean;
function TFairyRing.Close(escapeProbability: Double = BioHash): Boolean; overload;
Closes the FairyRing interface, depending on escape the function will either
press escape or click the close button:
Example:
WriteLn FairyRing.Close();
FairyRing.HandleItem¶
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:
if FairyRing.HandleItem() then
WriteLn FairyRing.Item;
FairyRing.Open¶
function TFairyRing.Open(cuboid: TCuboid): Boolean;
Attempts to open the closest fairy ring RSObject.
Example:
WriteLn FairyRing.Open();
FairyRing.IsLetterValid¶
function TFairyRing.IsLetterValid(letter: Char; dial: EFairyRingDial): Boolean;
Checks if the letter passed on is valid for the given dial.
Example:
WriteLn FairyRing.IsLetterValid('z', EFairyRingDial.LEFT);
FairyRing.IsCodeValid¶
function TFairyRing.IsCodeValid(fairyCode: String): Boolean;
Checks if the a given fairyCode is a valid fairy ring code.
Example:
WriteLn FairyRing.IsCodeValid('abc');
FairyRing.Spin¶
procedure TFairyRing.SpinLeft(dial: EFairyRingDial);
procedure TFairyRing.SpinRight(dial: EFairyRingDial);
Spins the given dial left or right.
Example:
WriteLn FairyRing.SpinLeft(EFairyRingDial.LEFT);
If you want, you can see the left and right dial blick boxes with the following code:
{$I WaspLib/main.simba}
begin
ShowOnTarget(FairyRing.RotateLeftBoxes + FairyRing.RotateRightBoxes);
end.
FairyRing.Letter¶
property TFairyRing.Letter(dial: EFairyRingDial): Char;
property TFairyRing.Letter(character: Char; dial: EFairyRingDial): Boolean;
Returns or sets the letter of a fairy ring dial.
Example:
WriteLn FairyRing.Letter[EFairyRingDial.RIGHT];
WriteLn FairyRing.Letter['p', EFairyRingDial.RIGHT];
WriteLn FairyRing.Letter[EFairyRingDial.RIGHT];
The letter in question that will be read or set is the one that is in the dial “hole”:
{$I WaspLib/main.simba}
begin
ShowOnTarget(FairyRing.DialHoles);
end.
FairyRing.Code¶
property TFairyRing.Code: String;
property TFairyRing.Code(code: String): Boolean;
Returns the current fairy ring code or sets the new one in the dials.
Example:
WriteLn FairyRing.Code;
WriteLn FairyRing.Code['DLP'];
WriteLn FairyRing.Code;
FairyRing.ClickTeleport¶
function TFairyRing.ClickTeleport(): Boolean;
Clicks the fairy ring the teleport button:
Example:
WriteLn FairyRing.ClickTeleport();
FairyRing TravelLog¶
This next section is about the fairy ring travel log GameTab menu:
FairyRing.GetLogCodes¶
function TFairyRing.GetLogCodes(out boxes: TBoxArray): TStringArray;
function TFairyRing.GetLogCodes(): TStringArray; overload;
Returns the visible codes in the fairy ring travel log.
Example:
{$I WaspLib/main.simba}
var
logs: TStringArray;
boxes: TBoxArray;
begin
logs := FairyRing.GetLogCodes(boxes);
if logs <> [] then
begin
WriteLn logs;
ShowOnTarget(boxes);
end;
end.
FairyRing.FindLogCode¶
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:
{$I WaspLib/main.simba}
var
b: TBox;
begin
if FairyRing.FindLogCode('ALQ', b) then
ShowOnTarget(b);
end.
FairyRing.ClickLogCode¶
function TFairyRing.ClickLogCode(fairyCode: String): Boolean;
Finds and clicks the fairyCode specified in the travel log.
Codes casing is ignored.
Example:
WriteLn FairyRing.ClickLogCode('cip');
FairyRing.HandleInterface¶
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:
WriteLn FairyRing.HandleInterface('cip');
FairyRing.Teleport¶
function TFairyRing.Teleport(fairyCode: String; obj: TGObject; walk: Boolean = True): Boolean;
function TFairyRing.Teleport(fairyCode: String; walk: Boolean = True): Boolean; overload;
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:
WriteLn FairyRing.Teleport('cip');
FairyRing variable¶
Global TFairyRing variable.