Fizzi
2007-08-21 17:34:03
Well, I turned my clay farmer on, and wen't to work. 6 hours or so later (According to the proggy that was still on the screen). This error showed up in the debug box: [Runtime Error] : Exception: Out of memory in line 341 in script C:\Program Files\SCAR 3.11\Scripts\My Soft Clay Farmer 2.0.scar . On top of that I had a popup window saying that SCAR had encountered an unexpected error or whatever (Pressing Ok closed SCAR).
Here is the function which contains line 341 (The line itself has a comment next to it):
That function above is called every time before the character clicks the rock, so it's called a lot. This error really upsets me because… It seems like the only thing that stops my scripts from making amazing runs now are SCAR errors (I get a SCAR error like every overnight run). It sucks, I still had 11 out of 12 players still running after 6 hours! So I'd like to know if anyone knows what the problem is, and if it's fixable. My laptop however, seems completely immune to this problem…
Here is the function which contains line 341 (The line itself has a comment next to it):
function FindMultiMovementColorTol(TStop, Frequency : Integer; ColorMoving : Integer;
x1, y1, x2, y2 : Integer; Tolerance : Integer; MCPixels : Integer) : boolean;
var
TSearch, PCount, CCount, MCCount, slength, sheight, i, k : Integer;
Movement : Boolean;
begin
slength := (x2 - x1);
sheight := (y2 - y1);
PCount := 0; CCount := 0;
for i := 0 to sheight do
begin
if (i = 0) or ((i mod 2) = 0) then
begin
for k := 0 to (slength/2) do
begin
setlength(Points, length(Points)+1); //This is line 341
Points[PCount].x := (x1 + (2*k));
Points[PCount].y := (y1 + i);
PCount := (PCount + 1);
end;
end else
begin
if((slength mod 2) = 0) then
begin
for k := 0 to ((slength/2) - 1) do
begin
setlength(Points, length(Points)+1);
Points[PCount].x := (x1 + 1 + (2*k));
Points[PCount].y := (y1 + i);
PCount := PCount + 1;
end;
end else
begin
for k := 0 to (slength/2) do
begin
setlength(Points, length(Points)+1);
Points[PCount].x := (x1 + 1 + (2*k));
Points[PCount].y := (y1 + i);
PCount := (PCount + 1);
end;
end;
end;
end;
MarkTime(TSearch);
repeat
for i := 0 to (PCount - 1) do
begin
setlength(Points[i].Color, length(Points[i].Color)+1);
Points[i].Color[CCount] := GetColor(Points[i].x, Points[i].y);
end;
CCount := CCount + 1;
Wait(Frequency);
until(TimeFromMark(TSearch) > TStop);
for i := 0 to (PCount - 1) do
begin
Movement := False;
for k := 0 to (CCount - 2) do
begin
if(Points[i].Color[k] <> Points[i].Color[k+1]) then Movement := True;
end;
if Movement then
begin
for k := 0 to (CCount - 1) do
begin
if(SimilarColors(Points[i].Color[k], ColorMoving, Tolerance)) then MCCount := MCCount + 1;
end;
end;
end;
if(MCCount >= MCPixels) then Result := True
else Result := False;
end;That function above is called every time before the character clicks the rock, so it's called a lot. This error really upsets me because… It seems like the only thing that stops my scripts from making amazing runs now are SCAR errors (I get a SCAR error like every overnight run). It sucks, I still had 11 out of 12 players still running after 6 hours! So I'd like to know if anyone knows what the problem is, and if it's fixable. My laptop however, seems completely immune to this problem…