Log in

View Full Version : Scripting Help.



Home
12-17-2010, 11:28 AM
The problems is that it won't draw the colors as it should, well it doesn't draw them at all. There is probaly something simple that i just don't see.





program ReflectionScript;
{$DEFINE SMART}
{$i srl\srl.scar}
{$i reflection\reflection.simba}
{$i srl/srl/misc/paintsmart.scar}

const


{---SMART Setup Constants---}
WORLD = 32;
MEMBERS = false;
SIGNED = true;
{---------------------------}

var
Playerss: TPlayerArray;
Dots, TextDots: array of TPointArray;
Colors: TIntegerArray;
i, Level, x, y, z: Integer;
TempPoint: TTile;
Ratio: string;

begin
Smart_Members := MEMBERS;
Smart_Server := WORLD;
Smart_Signed := SIGNED;

SetupSRL;
SetupReflectionEx(true);

SetArrayLength(Dots, 3);

Colors:= [65280, 16776960, 255];

repeat
Dots[0]:= [];
Dots[1]:= [];
Dots[2]:= [];
TextDots:= [];
Playerss:= GetPlayers;
Level:= GetMe.Level;
for i:=0 to High(Players) do
if (Playerss[i].Level < Level) then
begin
SetArrayLength(Dots[0], Length(Dots[0])+9);
TempPoint:= TileToMM(Playerss[i].Tile);
for z:=0 to 8 do
begin
x:= (z mod 3);
y:= (z div 3);
Dots[0][High(Dots[0])-z]:= Tile(TempPoint.x-1+x, TempPoint.y-1+y);
end;
end else
if (Playerss[i].Level = Level) then
begin
SetArrayLength(Dots[1], Length(Dots[1])+9);
TempPoint:= TileToMM(Playerss[i].Tile);
for z:=0 to 8 do
begin
x:= (z mod 3);
y:= (z div 3);
Dots[1][High(Dots[1])-z]:= Tile(TempPoint.x-1+x, TempPoint.y-1+y);
end;
end else
if (Playerss[i].Level > Level) then
begin
SetArrayLength(Dots[2], Length(Dots[2])+9);
TempPoint:= TileToMM(Playerss[i].Tile);
for z:=0 to 8 do
begin
x:= (z mod 3);
y:= (z div 3);
Dots[2][High(Dots[2])-z]:= Tile(TempPoint.x-1+x, TempPoint.y-1+y);
end;
end;
x:= 0;
for i:=0 to High(Players) do
if TileOnMS(Playerss[i].Tile, 30) then
begin
SetArrayLength(TextDots, Length(TextDots)+1);
TempPoint:= TileToMS(Playerss[i].Tile, 30);
if (Playerss[i]. HPRatio = 0) then
Ratio:= '100%'
else
Ratio:= IntToStr(Playerss[i].HPRatio)+'%';
TextDots[x]:= TPAFromText(Ratio, 'SmallChars', z, y);
for z:=0 to High(TextDots[x]) do
begin
IncEx(TextDots[x][z].x, TempPoint.x);
IncEx(TextDots[x][z].y, TempPoint.y);
end;
Inc(x);
end;
SMART_DrawDotsEx(True, Dots[0], Colors[0]);
SMART_DrawDotsEx(False, Dots[1], Colors[1]);
SMART_DrawDotsEx(False, Dots[2], Colors[2]);
for z:=0 to High(TextDots) do
Smart_DrawDotsEx(False, TextDots[z], 16776960);
until(false);

end.


~Home

Bad Boy JH
12-21-2010, 05:39 AM
is debug enabled on the SMART client?