Simba Code:
function FindWall(var fx, fy: Integer): Boolean;
var
arP, arAP: TPointArray;
arC, arUC: TIntegerArray;
ararP: T2DPointArray;
tmpCTS, i, j, arL, arL2: Integer;
P: TPoint;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(2.50, 2.99);
if not(FindColorsTolerance(arP, 2237991, MSX1, MSY1, MSX2, MSY2, 2)) then
begin
Writeln('Failed to find the color, no object found.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;
arC := GetColors(arP);
arUC := arC;
ClearSameIntegers(arUC);
arL := High(arUC);
arL2 := High(arC);
for i := 0 to arL do
begin
ColorToXYZ(arC[i], X, Y, Z);
if (X >= 1.54) and (X <= 2.11) and (Y >= 1.61) and (Y <= 2.19) and (Z >= 1.37) and (Z <= 2.24) then
begin
for j := 0 to arL2 do
begin
if (arUC[i] = arC[j]) then
begin
SetLength(arAP, Length(arAP) + 1);
arAP[High(arAP)] := arP[j];
end;
end;
end;
end;
SortTPAFrom(arAP, Point(MSCX, MSCY));
ararP := SplitTPAEx(arAP, 10, 10);
arL := High(ararP);
for i := 0 to arL do
begin
if (Length(ararP[i]) < 10) then Continue;
P := MiddleTPA(ararP[i]);
MMouse(P.x, P.y, 5, 5);
Wait(100 + Random(100));
if (IsUpText('Cross')) then
begin;
Result := True;
Break;
end;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if (i = arL + 1) then
begin
Writeln('FindObject could not find object.');
Exit;
end;
GetMousePos(fx, fy);
end;
function DoWalking:Boolean;
begin
SPS_Setup(RUNESCAPE_SURFACE, ['10_6','11_6']);
if Location = 'Bank'then
begin
Bnk2Drags := [Point(4215, 2663), Point(4220, 2660), Point(4227, 2654), Point(4233, 2646), Point(4241, 2639), Point(4250, 2629), Point(4267, 2619), Point(4280, 2617), Point(4293, 2613), Point(4297, 2598), Point(4297, 2583), Point(4309, 2578), Point(4327, 2576), Point(4347, 2577), Point(4368, 2577), Point(4382, 2577), Point(4393, 2572), Point(4408, 2566)];
if SPS_WalkPath(Bnk2Drags) then
begin
if FindWall then
Mouse(x, y, 0, 0,True);
end;
begin
Location:='Dragons';
Wait(RandomRange(500,600));
end else
Writeln('We got lost, please restart at the bank.');
exit;
end;
if Location = 'Dragons'then
begin
InvertTPA(Bnk2Drags);
if SPS_WalkPath(Bnk2Drags) then
begin
Location:='Bank';
Wait(RandomRange(500,600));
end else
Writeln('We got lost, please restart at the bank.');
exit;
end;
end;