SRL Archive - Research & Development Lounge

Getting other player's usernames using Reflection


Xenobitz

2014-04-04 13:33:54

Is this possible?
Also, is it possible to see the skill experience of other players while using reflection?

Ian

2014-04-04 13:51:07

I don't do anything with reflection so I may be wrong, but I don't see why you wouldn't be able to get usernames of the players around you. After all, this is information that your client has. I'm almost 100% sure you cannot get their experience though, because this is not something your client could have any reason for knowing.

Brandon

2014-04-04 14:23:02

From: Xenobitz
Is this possible?
Also, is it possible to see the skill experience of other players while using reflection?



You can do both actually.. There's just one question. Why do you need their username? For example, RS has two usernames. One is the login username and the other is the in game username.

Which are you speaking of here? Yes you can view other's experience and ingame username.

Frement

2014-04-04 14:35:32

Here you go:
program R_GetPlayers_TEST;
{$DEFINE SMART8}
{$I SRL-OSR/SRL.Simba}
{$I SRL-OSR/SRL/Misc/SmartGraphics.Simba}
{$I SRL-OSR/SRL/reflection/Reflection.simba}

type
TPlayer = record
Name: String;
Level: Integer;
end;

TPlayerArray = Array of TPlayer;

function CreatePlayer(Name: String; Level: Integer): TPlayer;
begin
Result.Name := Name;
Result.Level := Level;
end;

function R_GetPlayers: TPlayerArray;
var
I, J, _Count, _Player, _Name, _Level: Integer;
begin
_Count := SmartGetFieldArraySize(SmartCurrentTarget, 0, 'client.gm', 0);
SetLength(Result, J);
for I := 0 to _Count - 1 do begin
_Player := SmartGetFieldArrayObject(SmartCurrentTarget, 0, 'client.gm', I);
if (_Player <= 0) then
Continue;
Inc(J);
SetLength(Result, J);
_Name := SmartGetFieldObject(SmartCurrentTarget, _Player, 'i');
_Level := SmartGetFieldInt(SmartCurrentTarget, _Player, 's') * 531991939;
Result[J - 1] := CreatePlayer(R_GetJavaString(_Name, 512), _Level);
SmartFreeObject(SmartCurrentTarget, _Name);
SmartFreeObject(SmartCurrentTarget, _Player);
end;
end;

begin
SetupSRL;
SetupReflection;
Writeln(R_GetPlayers);
end.

For getting the experience, I would suggest getting the data from hiscores with the players name.

N1234

2014-04-08 10:45:52

yes you can. it is called the " Orion " client, and you can download it from Rsbuddy.org
i use it personally and it is great, plus it has been approved by JaGeX.