Nava2
2008-10-25 12:46:17
Since I have seen lots of slower, older ones. I made a faster and more up-to-date one! :)
Usage:
Rate, Hate?
// ACA v2 With mods from Nava2
function FindBirdsNest(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(0.10, 0.40);
if not(FindColorsTolerance(arP, 2832187, MSX1, MSY1, MSX2, MSY2, 11)) then
begin
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.06) and (X <= 8.30) and (Y >= 1.14) and (Y <= 8.78) and (Z >= 0.81) and (Z <= 5.83) then
for j := 0 to arL2 do
if (arUC[i] = arC[j]) then
begin
SetLength(arAP, Length(arAP) + 1);
arAP[High(arAP)] := arP[j];
end;
end;
ararP := SplitTPAEx(arAP, 10, 10);
SortATPAFrom(ararP, Point(MSCX, MSCY));
arL := High(ararP);
for i := 0 to arL do
begin
if (Length(ararP[i]) < 5) then Continue;
P := MiddleTPA(ararP[i]);
MMouse(P.x - 4, P.y - 4, 9, 9);
Wait(100 + Random(100));
if (IsUpText('Take Bird')) then
begin;
Result := True;
Break;
end;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
GetMousePos(fx, fy);
end;
function PickUpBirdsNest : Boolean;
var
x, y, SAngle, TAngle, T : Integer;
begin
Result := False;
if Pos('nest falls', GetBlackChatMessage) = 10 then
begin
Writeln('PickUpBirdsNest : Bird''s Nest has dropped, searching.');
SetAngle(True);
if FindBirdsNest(x, y) then
begin
Mouse(x, y, 0, 0, True);
Result := True;
Flag;
end else
begin
SAngle := Round(rs_GetCompassAngleDegrees);
TAngle := SAngle;
MarkTime(T);
repeat
TAngle := TAngle + RandomRange(40, 60);
if TAngle > (SAngle + 360) then
SetAngle(False);
if TAngle > (SAngle + 360 * 2) then
begin
SetAngle(True);
TAngle := SAngle;
end;
MakeCompass(IntToStr(TAngle));
if FindBirdsNest(x, y) then
begin
Mouse(x, y, 0, 0, True);
Flag;
Result := True;
Break;
end;
Wait(RandomRange(200, 300));
until (TimeFromMark(T) > 90000) or Result;
if (TimeFromMark(t) > 90000) and not Result then
Writeln('PickUpBirdsNest : Could not find Bird''s nest in 90 seconds.');
MakeCompass(IntToStr(SAngle));
end;
end;
if Result then Writeln('PickUpBirdsNest : Found and picked up Birds Nest.');
end;Usage:
if PickUpBirdsNest then
Inc(BirdsNestCount);Rate, Hate?