Shuttleu
2011-11-15 15:35:28
The colour was incorrect for for the text searching
~shut
{*******************************************************************************
function FindBirdsNest: Boolean;
By: Liquid and Starblaster100
Description: If a birds nest is found, it will pick it up
*******************************************************************************}
function FindBirdsNest: Boolean;
var
tries, x, y: Integer;
s: string;
begin
s:= GetChatBoxText(8, 255)
if (Pos(s, 'A bird') <> 0) then
begin
repeat
if not (FindObj(x, y, 'Take Bird', 3952984, 10)) or
not (FindObj(x, y, 'Take Bird', 1713706, 10)) or
not (FindObj(x, y, 'Take Bird', 1581604, 10)) then
begin
KeyDown(VK_LEFT);
Wait(700 + Random(500));
KeyUp(VK_LEFT);
Wait(400 + Random(300));
end;
if not (FindObj(x, y, 'Take Bird', 3952984, 10)) or
not (FindObj(x, y, 'Take Bird', 1713706, 10)) or
not (FindObj(x, y, 'Take Bird', 1581604, 10)) then
begin
x := 648;
y := 83;
tries := tries + 1;
FindColorSpiral(x, y, 241, 570, 5, 725, 155);
Mouse(x + 3, y + 3, 2, 2, True);
Flag;
Wait(200 + Random(100));
end;
if (FindObj(x, y, 'Take Bird', 3952984, 10)) or
(FindObj(x, y, 'Take Bird', 1713706, 10)) or
(FindObj(x, y, 'Take Bird', 1581604, 10)) then
begin
WriteLn('Birds Nest Found');
Wait(450 + Random(400));
GetMousePos(x, y);
Mouse(x, y, 0, 0, True);
Flag;
Result := True;
Wait(500 + Random(300));
if (Screenshots) then
SaveScreenshot('Birds Nest - SRL - ' + IntToStr(GetTimeRunning) + '.bmp');
tries := tries + 100;
// Birdsnest := Birdsnest + 1;
Mouse(583, 226, 2, 2, False);
Wait(100 + Random(100));
ChooseOption('Examine');
Exit;
end;
until (FindObj(x, y, 'Take Bird', 3952984, 10)) or
(FindObj(x, y, 'Take Bird', 1713706, 10)) or
(FindObj(x, y, 'Take Bird', 1581604, 10)) or (tries > 5)
end;
end; ~shut