Ah no nevermind about the length of your array ...
See for loops work like this, they add and add until it surpassed the statement value.
when you do
then after the for loop i will be 3.
Now in your script you do the for loop on :
Code:
for i := 0 to 3 do
if(FindEnt(fx, fy, false))then break;
Since there are no begins and ends it will only loop that line. After it is done with the loop i is 4, then it calls
Code:
if (FindObjCustom(X, Y, ['ak', 'Oak'], [OakTreeColor[i]], 3)) then // this is the line
begin
and OakTreeColor[4] errors..
I'm assuming you want this :
Code:
procedure ChopTheOaks;
begin
if WhichTreeToChop = 'Oak' then
begin
OakTreeColor[0] := 6464409;
OakTreeColor[1] := 2195310;
OakTreeColor[2] := 1715244;
OakTreeColor[3] := 11818;
repeat
if not Loggedin then Exit;
for i := 0 to 3 do
begin
if(FindEnt(fx, fy, false))then break;
if (FindObjCustom(X, Y, ['ak', 'Oak'], [OakTreeColor[i]], 3)) then // this is the line
begin
Mouse(x, y, 3, 3, True);
FFlag(0);
GameTab(4);
FindNormalRandoms;
MyAntiBannage;
Wait(5000);
end;
end;
until (invfull);
end;
end;