zeeky111
01-31-2011, 04:06 AM
Okay, so I read Naum's old tut on arrays, and I set up an array test for the standard Tree.
For right now, here it is:
program ArrayTest;
{$DEFINE SMART}
{$i SRL\SRL.scar}
{$i Reflection\Reflection.simba}
var
TreeColor: Array [0..3] of Integer;
TreeUpText: Array [0..1] of String;
cx, cy, i: Integer;
{procedure SetupSMART;
begin
Smart_Server := 17;
Smart_Members := false;
Smart_Signed := true;
Smart_SuperDetail := false;
SetupSRL;
end;}
procedure DeclareVars;
begin
MouseSpeed := 15;
Writeln('Vars declared.');
end;
procedure DeclareArrayColors;
begin
TreeColor[0] := 3170902;
TreeColor[1] := 3172444;
TreeColor[2] := 5013877;
TreeColor[3] := 4882549;
Writeln('Array colors declared.');
end;
procedure DeclareUpText;
begin
TreeUpText[0] := 'ree';
TreeUpText[1] := 'Tre';
Writeln('Tree UpText strings declared.');
end;
procedure SetupScript;
begin
ClearDebug;
DeclareVars;
DeclareUpText;
DeclareArrayColors;
end;
procedure FindTreeArray;
begin
for i:= 0 to 3 do
if (FindObjCustom(cx, cy, TreeUpText, TreeColor, 5)) then
begin
Writeln('Array found at ('+IntToStr(cx)+', '+IntToStr(cy)+').');
end else
Writeln('Array not found.');
end;
begin
SetupScript
FindTreeArray;
end.
(I realize that the SMART and Reflection includes are useless to this script as of yet.)
The script compiles just fine. It declares the variables, color arrays, and UpText arrays beautifully. But when it gets to procedure FindTreeArray it stops. It doesn't cancel, exit, or terminate the script, it just does nothing and keeps running, doing nothing.
What's up here?
Thanks all.
For right now, here it is:
program ArrayTest;
{$DEFINE SMART}
{$i SRL\SRL.scar}
{$i Reflection\Reflection.simba}
var
TreeColor: Array [0..3] of Integer;
TreeUpText: Array [0..1] of String;
cx, cy, i: Integer;
{procedure SetupSMART;
begin
Smart_Server := 17;
Smart_Members := false;
Smart_Signed := true;
Smart_SuperDetail := false;
SetupSRL;
end;}
procedure DeclareVars;
begin
MouseSpeed := 15;
Writeln('Vars declared.');
end;
procedure DeclareArrayColors;
begin
TreeColor[0] := 3170902;
TreeColor[1] := 3172444;
TreeColor[2] := 5013877;
TreeColor[3] := 4882549;
Writeln('Array colors declared.');
end;
procedure DeclareUpText;
begin
TreeUpText[0] := 'ree';
TreeUpText[1] := 'Tre';
Writeln('Tree UpText strings declared.');
end;
procedure SetupScript;
begin
ClearDebug;
DeclareVars;
DeclareUpText;
DeclareArrayColors;
end;
procedure FindTreeArray;
begin
for i:= 0 to 3 do
if (FindObjCustom(cx, cy, TreeUpText, TreeColor, 5)) then
begin
Writeln('Array found at ('+IntToStr(cx)+', '+IntToStr(cy)+').');
end else
Writeln('Array not found.');
end;
begin
SetupScript
FindTreeArray;
end.
(I realize that the SMART and Reflection includes are useless to this script as of yet.)
The script compiles just fine. It declares the variables, color arrays, and UpText arrays beautifully. But when it gets to procedure FindTreeArray it stops. It doesn't cancel, exit, or terminate the script, it just does nothing and keeps running, doing nothing.
What's up here?
Thanks all.