Athylus
2014-07-01 17:39:41
Hey all. Nearly finished my woodcutting script and I am planning on sharing it with the community as well, because if this part is done then it works like a charm. Gets you those early lvls you know. Here is the code:
Type mismatch at line 168. What's going on? Here's basically what I want: I want this procedure to look for trees, and if it doesn't find them in 3-4 tries then I want it to exit and go to the next part in the main loop.
procedure ChopTree;
var
x, y, Retry: Integer;
begin
Retry := 0;
repeat
if not Chopping then
begin
begin
FindNormalRandoms;
Inc(Retry);
WriteLn('Attempt number ' + Retry + ' to find the tree');
if(Retry > 3) then //Line 168
begin
WriteLn('Could not find tree, walking to trees');
Exit;
end;
end;
if FindObj(x, y, 'hop do', TreeColor, 5) then
begin
WriteLn('Tree found');
Mouse(x, y, 5, 5, false);
ChooseOption('Chop down');
Wait(200 + random(450));
end;
end else
begin
WriteLn('Chopping...');
Wait(200);
end;
until(InvFull);
end;
Type mismatch at line 168. What's going on? Here's basically what I want: I want this procedure to look for trees, and if it doesn't find them in 3-4 tries then I want it to exit and go to the next part in the main loop.