SRL Archive - RS3 Script Requests

A Request by Home


Home

2010-12-16 16:21:27

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

mormonman

2010-12-16 16:33:07

It is very possible, but it would lag a lot.

Home

2010-12-16 16:36:44

From: mormonman
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

2010-12-16 17:08:49

i am on it!

~shut

Home

2010-12-16 17:22:48

From: Shuttleu
i am on it!

~shut



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

Good luck!

~Home

Capricorn

2010-12-16 17:36:58

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

2010-12-16 18:03:02

http://villavu.com/forum/showthread.php?p=759681#post759681
help please :)

~shut

Shuttleu

2010-12-16 19:19:28

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

mormonman

2010-12-16 19:29:18

He meant players, not NPCs…

Shuttleu

2010-12-16 19:30:32

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

2010-12-18 04:30:06

From: Shuttleu
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

2010-12-18 07:41:39

you need to enable debugging on smart

~shut

Home

2010-12-18 09:29:14

From: Shuttleu
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

2010-12-18 09:42:06


Home

2010-12-18 10:15:02

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

2010-12-18 10:30:50

From: Home
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

2010-12-18 10:57:04

From: Home
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

2010-12-18 11:44:35

Thanks, now it works.


~Home