Chris!
2013-01-21 00:58:14
So my script successfully chops tree, but when the inventory is full it keeps trying to chop and doesn't even attempt to walk to the bank.
Cheers.
Another thing: My script hovers around trees but doesn't click 'em.
Any help appreciated.
Procedure ChopTree;
var
x, y, Attempts: Integer;
begin
FindNormalRandoms;
repeat
MarkTime(TooLong);
FindNormalRandoms;
while (WaitWhileChopping) do
begin
if (InvFull) then
Exit;
Wait(500+Random(250));
end;
if (FindTree) then
begin
if (InvFull) then
Break;
GetMousePos(x, y);
case random(2) of
0: begin
HumanMMouse(x, y, 5, 5);
FastClick(mouse_left);
end;
1: begin
HumanMMouse(x, y, 5, 5);
WaitOption('Chop', 500);
FastClick(mouse_left);
end;
end;
end else
begin
Inc(Attempts);
Writeln('Can not find tree, trying again.');
Wait (2000 + Random(1500));
Continue;
end;
repeat
Antiban;
until (PlayerIdle) or (TimeFromMark(TooLong) > 60000) or (InvFull);
until(InvFull) or (Attempts > 7);
if (Attempts > 7) then (FailSafe('Could not find tree. Shutting down.'));
end; Cheers.
Another thing: My script hovers around trees but doesn't click 'em.
Function FindTree: Boolean;
var
tmpCTS, l, i, r: Integer;
TreeTPA: TPointArray;
begin
tmpCTS := GetToleranceSpeed;
SetColorToleranceSpeed(2);
SetToleranceSpeed2Modifiers(0.37, 0.87);
FindColorsTolerance(TreeTPA, 2373174, MSX1, MSY1, MSX2, MSY2, 7);
SetColorToleranceSpeed(tmpCTS);
SetToleranceSpeed2Modifiers(0.02, 0.02);
L := High(TreeTPA)
MarkTime(TooLong);
for i := 0 to L do
begin
r := random(L);
Wait(RandomRange(40, 170));
HumanMMouse(TreeTPA[R].x, TreeTPA[R].y, 2, 2);
if WaitUpTextMulti(['Chop', 'down', 'Willow'], 300) then
begin
Result := True;
Writeln('Found a tree. Chopping.');
Fastclick(Mouse_Left);
Break;
end;
if TimeFromMark(TooLong) > 20000 then
FailSafe('We could not find a tree.');
end;
end; Any help appreciated.