SCAR Code:
Function FindAuburyText: Boolean; // FindTalk by Renax, but adepted.
var
ExitCond, NoMoreYellow: Boolean;
Yint, Xmin, diff, difflast, Xmax, XmidRec, Xmid: Integer;
RawMenuText: string;
begin
x := 0;
y := 0;
Xmid := 0;
Xmin := 0;
Xmax := 0;
NoMoreYellow := False;
if (FindColor(x, y, 65535, 10, 25, 511, 334)) and (not (FindColor(x, y, 65280, 220, 130, 290, 165))) then
begin
Result := False;
if (not (FindBitmapMaskTolerance(AuburyText, x, y, 0, 0, 516, 338, 0, 40)))
then
Exit;
if (FindColorSpiral(x, y, 65535, x - 10, y - 10, x + 10, y + 10)) then
begin
Wait(10);
if (GetColor(x, y) = 65535) then
begin
If WizzyDebug Then WriteLn('Spotted aubury text');
Wait(10);
NoMoreYellow := False;
Yint := 0;
repeat
Yint := Yint + 1;
y := y + Yint;
x := 0;
repeat
ExitCond := False;
x := x + 1;
Xmin := x;
if (GetColor(x, y) = 65535) then
ExitCond := True;
if (x > 500) then
begin
x := 0;
ExitCond := True;
NoMoreYellow := True;
end;
until (ExitCond);
ExitCond := False;
x := 520;
while (NoMoreYellow = False) and (ExitCond = False) do
begin
x := x - 1;
Xmax := x;
if (GetColor(x, y) = 65535) then
ExitCond := True;
end;
diff := (Xmax - Xmin);
if (diff > difflast) and (diff > 25) then
begin
XmidRec := ((diff / 2) + Xmin);
end;
difflast := diff;
until (NoMoreYellow)
x := XmidRec;
MMouse(x, y + 6, 3, 0);
Wait(100);
if IsUpTextMulti('Talk', 'lk-to', 'to') Then
begin
GetMousePos(x, y);
Mouse(x, y + 6, 0, 0, False);
if (ChooseOptionGetMenuText(RawMenuText, x, y, 'Teleport')) then
begin
If WizzyDebug Then WriteLn('Found Aubury')
FFlag(1);
Wait(1000 + Random(500))
Result := True;
Exit;
end;
end;
end;
end;
end;
end;