PDA

View Full Version : [Utility] A Request by Home



Home
12-16-2010, 09:21 PM
Hello, this is my request.


By using Reflection, would Draw players who you could kill on screen and minimap. For lower level players would be green and higher to red.

And possibility to draw peoples HP Above heads.

I don't know is this even possible but if it is, give it a try :)



Thanks.

~Home

tls
12-16-2010, 09:33 PM
It is very possible, but it would lag a lot.

Home
12-16-2010, 09:36 PM
It is very possible, but it would lag a lot.

it would be great if someone would try. And show the code like in this thread. At the moment i can't even try, my arm is totally broken...

And i'm not sure, my scripting skills are totally vanished, well not totally :)

~Home

Shuttleu
12-16-2010, 10:08 PM
i am on it!

~shut

Home
12-16-2010, 10:22 PM
i am on it!

~shut


Thanks matey. I will try answer all questions if you come up with anything.

Good luck!

~Home

Capricorn
12-16-2010, 10:36 PM
Drawing HP above heads is impossible since Jagex made all the HP server side a loooong time ago. The best you can do is draw the percentage.

Shuttleu
12-16-2010, 11:03 PM
http://villavu.com/forum/showthread.php?p=759681#post759681
help please :)

~shut

Shuttleu
12-17-2010, 12:19 AM
how is this
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
NPCs: TNPCArray;
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:= [255, 16776960, 65280];

repeat
Dots[0]:= [];
Dots[1]:= [];
Dots[2]:= [];
TextDots:= [];
NPCs:= GetNPCs;
Level:= GetMe.Level;
for i:=0 to High(NPCs) do
if InStrArr('Attack', NPCs[i].Actions, false) then
if (NPCs[i].Level < Level) then
begin
SetArrayLength(Dots[0], Length(Dots[0])+9);
TempPoint:= TileToMM(NPCs[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 (NPCs[i].Level = Level) then
begin
SetArrayLength(Dots[1], Length(Dots[1])+9);
TempPoint:= TileToMM(NPCs[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 (NPCs[i].Level > Level) then
begin
SetArrayLength(Dots[2], Length(Dots[2])+9);
TempPoint:= TileToMM(NPCs[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(NPCs) do
if InStrArr('Attack', NPCs[i].Actions, false) then
if TileOnMS(NPCs[i].Tile, 30) then
begin
SetArrayLength(TextDots, Length(TextDots)+1);
TempPoint:= TileToMS(NPCs[i].Tile, 30);
if (NPCs[i].HPRatio=0) then
Ratio:= '100%'
else
Ratio:= IntToStr(NPCs[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.

~shut

tls
12-17-2010, 12:29 AM
He meant players, not NPCs...

Shuttleu
12-17-2010, 12:30 AM
ahhh... ok
i shall update

~shut

EDIT:
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
Players: 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:= [];
Players:= GetPlayers;
Level:= GetMe.Level;
for i:=0 to High(Players) do
if (Players[i].Level < Level) then
begin
SetArrayLength(Dots[0], Length(Dots[0])+9);
TempPoint:= TileToMM(Players[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 (Players[i].Level = Level) then
begin
SetArrayLength(Dots[1], Length(Dots[1])+9);
TempPoint:= TileToMM(Players[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 (Players[i].Level > Level) then
begin
SetArrayLength(Dots[2], Length(Dots[2])+9);
TempPoint:= TileToMM(Players[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(Players[i].Tile, 30) then
begin
SetArrayLength(TextDots, Length(TextDots)+1);
TempPoint:= TileToMS(Players[i].Tile, 30);
if (Players[i].HPRatio=0) then
Ratio:= '100%'
else
Ratio:= IntToStr(Players[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.
there

Home
12-18-2010, 09:30 AM
ahhh... ok
i shall update

~shut

EDIT:
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
Players: 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:= [];
Players:= GetPlayers;
Level:= GetMe.Level;
for i:=0 to High(Players) do
if (Players[i].Level < Level) then
begin
SetArrayLength(Dots[0], Length(Dots[0])+9);
TempPoint:= TileToMM(Players[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 (Players[i].Level = Level) then
begin
SetArrayLength(Dots[1], Length(Dots[1])+9);
TempPoint:= TileToMM(Players[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 (Players[i].Level > Level) then
begin
SetArrayLength(Dots[2], Length(Dots[2])+9);
TempPoint:= TileToMM(Players[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(Players[i].Tile, 30) then
begin
SetArrayLength(TextDots, Length(TextDots)+1);
TempPoint:= TileToMS(Players[i].Tile, 30);
if (Players[i].HPRatio=0) then
Ratio:= '100%'
else
Ratio:= IntToStr(Players[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.
there


Thanks matey :)
Thought, it won't draw anything at the moment, i don't know wht. But i will try to solve it :)

~Home

Shuttleu
12-18-2010, 12:41 PM
you need to enable debugging on smart

~shut

Home
12-18-2010, 02:29 PM
you need to enable debugging on smart

~shut

Yep i did. : / But still no drawing.. And i needed to edit it- Nothing big but Replace Players with Playerss and smae i did fot variables because it said dublicate idenfiter : /


Could you post a picture or something. Would be great to get this to work. And thanks again for your effort.


~Home

Shuttleu
12-18-2010, 02:42 PM
http://img413.imageshack.us/img413/9379/smart1.png
http://img651.imageshack.us/img651/8730/smart2m.png

Home
12-18-2010, 03:15 PM
Did you replace:

Players: TPlayerArray;

With Playerss: TPlayerArray;

Because I'm getting an [Error] (18:3): Duplicate identifier 'Players' at line 17

Any ideas :)

~Home

Train
12-18-2010, 03:30 PM
Did you replace:

Players: TPlayerArray;

With Playerss: TPlayerArray;

Because I'm getting an [Error] (18:3): Duplicate identifier 'Players' at line 17

Any ideas :)

~Home
Do that. ;)

Since he's offline:
program ReflectionScript;
{$DEFINE SMART}
{$i srl\srl.scar}
{$i reflection\reflection.simba}
{$i srl/srl/misc/paintsmart.scar}

const
WORLD = 32;
MEMBERS = false;
SIGNED = true;

var
rPlayers: 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 := [];
rPlayers := GetPlayers;
Level := GetMe.Level;
for i := 0 to High(rPlayers) do
if (rPlayers[i].Level < Level) then
begin
SetArrayLength(Dots[0], Length(Dots[0]) + 9);
TempPoint := TileToMM(rPlayers[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 (rPlayers[i].Level = Level) then
begin
SetArrayLength(Dots[1], Length(Dots[1])+9);
TempPoint := TileToMM(rPlayers[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 (rPlayers[i].Level > Level) then
begin
SetArrayLength(Dots[2], Length(Dots[2])+9);
TempPoint:= TileToMM(rPlayers[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(rPlayers) do
if TileOnMS(rPlayers[i].Tile, 30) then
begin
SetArrayLength(TextDots, Length(TextDots)+1);
TempPoint:= TileToMS(rPlayers[i].Tile, 30);
if (rPlayers[i].HPRatio=0) then
Ratio:= '100%'
else
Ratio:= IntToStr(rPlayers[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.

Shuttleu
12-18-2010, 03:57 PM
Did you replace:

Players: TPlayerArray;

With Playerss: TPlayerArray;

Because I'm getting an [Error] (18:3): Duplicate identifier 'Players' at line 17

Any ideas :)

~Home

well in my version Players was still called NPCs because i changed NPCs to Players in the thread

~shut

Home
12-18-2010, 04:44 PM
Thanks, now it works.


~Home