I put some comments in.
Simba Code:
procedure ChopTree;
// ALWAYS DECLARE X AND Y LOCALLY! I added it for you.
var
x,y: integer;
begin
repeat
if FindColorSpiralTolerance(x, y, TreeColour, TreeX1, TreeY1, TreeX2, TreeY2, TreeColourTolerance) then
begin
writeln('Chopping magic tree...');
Mouse (x ,y ,0 , 0, True); // Add some randomness... it could help you to both avoid bot detection and click the tree
// What you could also do is:
Mouse(x,y,2,2,False);
Clickmouse2(False);
Chooseoption('hop');
end;
repeat
Wait(1000); // I would change this to 100 or less.
writeln('Waiting...');
Until (FindColorSpiralTolerance(x, y, StumpColour, TreeX1, TreeY1, TreeX2, TreeY2, StumpColourTolerance)
or (FindColorSpiralTolerance (x, y, 3029313, 653, 438, 669, 449, 20)) = False)
writeln('Stump Detected, Waiting for magic tree');
// So if I read this right, you are saying that you will wait for a stump basically forever?
wait(3000); //Again, a bit long in terms of wating
until not(FindColorSpiralTolerance(x, y, 3029313, 653, 438, 669, 449, 20)); //the color code is the color of the last slot in inventory and is covered by logs
//So it waits until the last slot of the inventory is full? Even when they are waiting for the stump?
Writeln('Inventory full, Walking to bank.');
end;
You are getting the error because you say that when you click on the tree, spam "waiting" every 3 seconds until you find a stump- which after that will continue to wait for even longer.
Trying to help
EDIT: This is all from memory, so it may be incorrect.
EDIT2: I'll try to rewrite this to my liking using your code... with no compiler help so it may not work. :$
Simba Code:
procedure ChopTree;
var
x,y: integer;
begin
repeat
if FindColorSpiralTolerance(x, y, TreeColour, TreeX1, TreeY1, TreeX2, TreeY2, TreeColourTolerance) then
begin
Mouse (x ,y ,2 , 3, False);
Clickmouse2(False);
ChooseOption('hop');
if (didredclick) then writeln('We are chopping a magic tree');
end;
repeat
Wait(100);
if (FindColorSpiralTolerance(x, y, StumpColour, TreeX1, TreeY1, TreeX2, TreeY2, StumpColourTolerance)
or (FindColorSpiralTolerance (x, y, 3029313, 653, 438, 669, 449, 20)) = False)
wait(3000);
until(FindColorSpiralTolerance(x, y, TreeColour, TreeX1, TreeY1, TreeX2, TreeY2, TreeColourTolerance));
Writeln('There is a new magic tree for us to cut');
until(invfull);
end;
Sort of doesn't make sense, but I think its on to something. This isn't the coding format I regularly use (TPA's <3) and I did the best with what I had. Good start on your own script though!