PriSoner
2008-02-03 11:51:49
The Current Function is Broken and could never work. :duh: (the logic in the initial if statement is back to front) I suspect at some point it has been deliberately broken as if the initial error is corrected it can end up getting stuck and never ending..
I have written my own function and tested it, after a few revisions it now works for me in my script without a single problem it has never missed a nest drop or failed to pick it up.
It has been tested extensively in EdgeVille, It could do with testing in other tree locations and I would appreciate anyone will to test it and provide feedback.
It can be dropped into SRL as a replacement to the existing non working function and all existing scripts that reference it will still be compatible and actually start picking up nests as intended. :)
It would seem that nearly every woodcutting script uses this function even though it doesn't work, so an update would probably go down well. :)
Please Give it a go and Give me feedback..
Updated 07 Feb 2007 Please read post #17 for changes.
My original function for comparison
If You Use and Like it Please Rate This Thread..
I have written my own function and tested it, after a few revisions it now works for me in my script without a single problem it has never missed a nest drop or failed to pick it up.
It has been tested extensively in EdgeVille, It could do with testing in other tree locations and I would appreciate anyone will to test it and provide feedback.
It can be dropped into SRL as a replacement to the existing non working function and all existing scripts that reference it will still be compatible and actually start picking up nests as intended. :)
It would seem that nearly every woodcutting script uses this function even though it doesn't work, so an update would probably go down well. :)
Please Give it a go and Give me feedback..
Updated 07 Feb 2007 Please read post #17 for changes.
{*******************************************************************************
function: MyFindBirdsNest: Boolean;
By: Prisoner
Description: Attempts to a Find Birds Nest if one is dropped & Pick it up.
If it can't find one within 90 seconds it exits as Fallen Birds Nests do not last that long.
Returns User to Users Last Compass Position when it exits.
*******************************************************************************}
function MyFindBirdsNest;
var OriginalDegrees, NewDegree, StartFBN, x, y, i, ctab: Integer;
b: boolean;
begin
if not LoggedIn then exit;
if Pos('nest falls', GetBlackChatMessage) = 10 then
begin
result := true;
b := false;
writeln('Birds Nest Drop Detected. Attempting To Find It...');
MarkTime(StartFBN);
SetAngle(true);
OriginalDegrees := Round(rs_GetCompassAngleDegrees);
NewDegree := OriginalDegrees;
ctab := GetCurrentTab;
repeat
if (FindObj(x, y, 'Take Bird', 3623505, 6)) then
begin
WriteLn('Birds Nest Found. Picking Up...');
Mouse(x, y, 1, 1, True);
Flag;
Wait(500 + Random(500));
Birdsnest := Birdsnest + 1;
GameTab(4);
SetAngle(true);
MakeCompass(IntToStr(OriginalDegrees));
GameTab(ctab);
for i := 1 to 5 do
begin
Mouse(575, 225, 3, 3, False);
Wait(300 + Random(500));
ChooseOption('xamine');
Wait(1000 + Random(1000));
if Pos('nest falls', GetBlackChatMessage) <> 10 then exit;
end;
exit;
end else
begin
if b then
begin
SetAngle(false);
b := false;
end else
begin
SetAngle(True);
NewDegree := (NewDegree + 25 + Random(30));
MakeCompass(IntToStr(NewDegree));
b := true;
end;
end;
until TimeFromMark(StartFBN) > 90000;
WriteLn('Birds Nest Not Found Within Required Time. Aborting...');
MakeCompass(IntToStr(OriginalDegrees));
SetAngle(True);
GameTab(ctab);
for i := 1 to 28 do
begin
if ExistsItem(i) then
begin
MMouseItem(i);
GetMousePos(x, y);
Mouse(x, y, 5, 5, false);
Wait(300 + Random(500));
ChooseOption('Examine');
Wait(1000 + Random(1000));
if Pos('nest falls', GetBlackChatMessage) <> 10 then exit;
end else
begin
GameTab(5);
Wait(1000 + Random(900));
Mouse(580, 300, 5, 5, false);
Wait(300 + Random(500));
ChooseOption('xamine');
Wait(1000 + Random(1000));
end;
end;
exit;
end;
end;
My original function for comparison
{*******************************************************************************
function: MyFindBirdsNest: Boolean;
By: Prisoner
Description: Attempts to a Find Birds Nest if one is dropped & Pick it up.
If it can't find one within 90 seconds it exits as Fallen Birds Nests do not last that long.
Returns User to Users Last Compass Position when it exits.
*******************************************************************************}
function: MyFindBirdsNest: Boolean;
var OriginalDegrees, NewDegree, StartFBN, x, y: Integer;
b: boolean;
begin
result := false;
if not LoggedIn then exit;
if Pos('nest falls', GetNewChatMsg) = 10 then
begin
result := true;
b := false;
writeln('Birds Nest Drop Detected. Attempting To Find It...');
MarkTime(StartFBN);
SetAngle(true);
OriginalDegrees := Round(rs_GetCompassAngleDegrees);
NewDegree := OriginalDegrees;
repeat
if (FindObj(x, y, 'Take Bird', 3623505, 6)) then
begin
WriteLn('Birds Nest Found. Picking Up...');
Mouse(x, y, 1, 1, True);
Flag;
Wait(500 + Random(500));
Birdsnest := Birdsnest + 1;
GameTab(4);
Mouse(575, 225, 5, 5, False);
ChooseOption('Examine');
Wait(1000 + Random(1000));
SetAngle(true);
MakeCompass(IntToStr(OriginalDegrees));
exit;
end else
begin
if b then
begin
SetAngle(false);
b := false;
end else
begin
SetAngle(True);
NewDegree := (NewDegree + 25 + Random(30));
MakeCompass(IntToStr(NewDegree));
b := true;
end;
end;
until TimeFromMark(StartFBN) > 90000;
WriteLn('Birds Nest Not Found Within Required Time. Aborting...');
GameTab(4);
Mouse(575, 225, 5, 5, False);
ChooseOption('Examine');
MakeCompass(IntToStr(OriginalDegrees));
end;
end;If You Use and Like it Please Rate This Thread..