PDA

View Full Version : How do I go about get NPC/Object ID's, Tile X/Y and more?



holic
07-20-2015, 09:14 PM
The title says all really. Is there a client you use that lists those values or just write a script to manually print everything out?
I'd like to start scripting again, using reflection, but I can't figure out the values I need.

Kyle
07-20-2015, 10:11 PM
holic;


program Test;
{$DEFINE SMART}
{$i Reflection/Reflection.simba}

var
Npcs: TReflectNpcArray;
I: Integer;

begin
Reflect.Setup;
Npcs.GetAll;
for I := 0 to High(Npcs) do
begin
WriteLn(Npcs[I].GetName);
WriteLn(Npcs[I].GetTile);
end;
end;


Try checking out my tutorial here (https://villavu.com/forum/showthread.php?t=111664) for more help

With the Lape include you can search for npc's and Interactable objects Via names, so you shouldn't need to look up anything unless I misunderstand your question.

holic
07-20-2015, 10:53 PM
elfyyy;

Thanks for your answer. I guess it wasn't all in the title, my bad.

I'm just thinking back to older clients in which you could turn on debugging for NPCs, objects, or items and they would have their IDs listed above them on screen. I was curious if there was anything like that these days or if everyone just wrote simple scripts to output the values they needed.

Interesting. I'm used to using IDs rather than names for objects but I'll just search by name.

Brandon
07-21-2015, 12:13 AM
elfyyy;

Thanks for your answer. I guess it wasn't all in the title, my bad.

I'm just thinking back to older clients in which you could turn on debugging for NPCs, objects, or items and they would have their IDs listed above them on screen. I was curious if there was anything like that these days or if everyone just wrote simple scripts to output the values they needed.

Interesting. I'm used to using IDs rather than names for objects but I'll just search by name.


You should be able to search by ID already. Searching by name is inefficient.

Kyle
07-21-2015, 01:15 AM
You should be able to search by ID already. Searching by name is inefficient.

Yeah you can search by Id, though the advantage is quite negligible..


program Test;
{$DEFINE SMART}
{$i Reflection/Reflection.simba}

var
Npcs: TReflectNpcArray;
I: Integer;
Names, Ids: Extended;
C: TReflectTimer;

begin
Reflect.Setup;
C.Start;
for I := 0 to 5000 do
begin
Npcs.Get('Banker');
Names := Names + C.ElapsedTime;
C.Restart;
end;
for I := 0 to 5000 do
begin
Npcs.Get(2898);
Ids := Ids + C.ElapsedTime;
C.Restart;
end;
Names := Names / 5001;
Ids := Ids / 5001;
WriteLn('Average time for Name searching: ' + ToStr(Names) + 'ms');
WriteLn('Average time for Id searching: ' + ToStr(Ids) + 'ms');
end;




Compiled successfully in 781 ms.
[21:14:29:181] [Reflection] [Status] Paired with SMART client 5724.
[21:14:29:184] [Reflection] [Status] Successfully setup!
Average time for Name searching: 2.38072385522895ms
Average time for Id searching: 2.34633073385323ms
[21:14:52:857] [Reflection] [Status] All cached references free'd from memory
Successfully executed.

holic
07-21-2015, 03:52 AM
Cheers guys. In this case, I need to search by ID.
This has been very helpful.

hakishakataki
09-23-2015, 08:04 PM
Yeah you can search by Id, though the advantage is quite negligible..


program Test;
{$DEFINE SMART}
{$i Reflection/Reflection.simba}

var
Npcs: TReflectNpcArray;
I: Integer;
Names, Ids: Extended;
C: TReflectTimer;

begin
Reflect.Setup;
C.Start;
for I := 0 to 5000 do
begin
Npcs.Get('Banker');
Names := Names + C.ElapsedTime;
C.Restart;
end;
for I := 0 to 5000 do
begin
Npcs.Get(2898);
Ids := Ids + C.ElapsedTime;
C.Restart;
end;
Names := Names / 5001;
Ids := Ids / 5001;
WriteLn('Average time for Name searching: ' + ToStr(Names) + 'ms');
WriteLn('Average time for Id searching: ' + ToStr(Ids) + 'ms');
end;




Compiled successfully in 781 ms.
[21:14:29:181] [Reflection] [Status] Paired with SMART client 5724.
[21:14:29:184] [Reflection] [Status] Successfully setup!
Average time for Name searching: 2.38072385522895ms
Average time for Id searching: 2.34633073385323ms
[21:14:52:857] [Reflection] [Status] All cached references free'd from memory
Successfully executed.


When i run this, I am pulling a

"Error: Unknown declaration "SSLSocket" at line 79
Compiling failed."