SRL Archive - Jr. Member General Help and Discussion

bring back some topics if they are still there for reflection?


samerdl

2013-09-07 12:59:40

Long-shot, but am lost here and i've exhausted every other resource to no avail and i hate to nag n3ss3s so often..

@Daniel perhaps you can help?

Tldr: Are the reflection tutorials still available? like this one? if they are can they be made public? (that link asks for a password which am sure none of us have).

worth a try..

Hoodz

2013-09-07 13:01:46

support, i think n3ss3s is getting tired of us :P

rj

2013-09-07 13:17:09

What do you mean reflection tutorial do you mean how to obtain hooks? In that case then javahacking would be your best option -.-

you could also look at some reflection scripts http://villavu.com/forum/forumdisplay.php?f=447

samerdl

2013-09-07 14:42:45

From: Officer Barbrady
What do you mean reflection tutorial do you mean how to obtain hooks? In that case then javahacking would be your best option -.-

you could also look at some reflection scripts http://villavu.com/forum/forumdisplay.php?f=447


Beyond that, looking at scripts (GetNpc(,,)) just doesn't cut it, i need to understand how the function is made and what each line means and what each hook correlates to, JavaHacking has very little content regarding this subject - that forum is for users that already know the basics.

One of the only few 'tutorials' for Hooking with Simba was posted by Echo_ on Mopar's site - this is the type of data i wish to learn; what does laq, luq and all those methods mean for hooks? i understand integer, string.. My only chance is to find some SRL tutorials that explain how exactly to use Reflection on Simba..


function R_GetNPCsMulti(TheVarArr: TVariantArray; Null: Boolean): TNPCArray;
var
NumNPCs, BaseX, BaseY, LoopCycle, H, C, I, K, H2: Integer;
TheNPCNode, TheNPC, NPCDef, vType, TempID: Integer;
TheName: String;
NPCs: TNPCArray;
B: Boolean;
begin
NumNPCs := SmartGetFieldInt(0,hook_static_NPCCount);
if (NumNPCs < 1) then
Exit;

BaseX := SmartGetFieldInt(0, hook_static_BaseX);
BaseY := SmartGetFieldInt(0, hook_static_BaseY);
LoopCycle := SmartGetFieldInt(0, hook_static_LoopCycle);
C := 0;

SetArrayLength(NPCs, NumNPCs);
H := NumNPCs-1;
for I := 0 to H do
try
TheNPCNode := SmartGetFieldArrayObject(0, hook_static_NPCNodes, I);
TheNPC := SmartGetFieldObject(TheNPCNode, hook_npcnode_NPC);
NPCDef := SmartGetFieldObject(TheNPC, hook_npc_NPCDef);
TheName := Lowercase(Trim(SmartGetFieldString(NPCDef, hook_npcdef_Name)));

if((not Null) and (TheName = 'null'))then
continue;

TempID := SmartGetFieldInt(NPCDef, hook_npcdef_ID);

H2 := High(TheVarArr);
B := False;
for K := 0 to H2 do
begin
vType := VarType(TheVarArr[K]);
if (vType = varString) then
TheVarArr[K] := LowerCase(Trim(TheVarArr[K]));
case vType of
varInteger: B := TempID = TheVarArr[K];
varString: B := (Pos(TheVarArr[K], LowerCase(Trim(TheName))) > 0);
else Exit;
end;
if B then
Break;
end;
if not B then
Continue;

with NPCs[C] do
begin
Index := SmartGetFieldArrayInt(0, hook_static_NPCIndexArray, I);
Level := SmartGetFieldInt(TheNPC, hook_npc_Level);
Name := TheName;
ID := TempID;

Actions := R_GetNPCActionArray(NPCDef);

Tile.X := BaseX + (SmartGetFieldInt(TheNPC, hook_animable_PixelX) / 512);
Tile.Y := BaseY + (SmartGetFieldInt(TheNPC, hook_animable_PixelY) / 512);
TileArea.X1 := (BaseX + SmartGetFieldShort(TheNPC, hook_animableentity_AreaX1));
TileArea.Y1 := (BaseY + SmartGetFieldShort(TheNPC, hook_animableentity_AreaY1));
TileArea.X2 := (BaseX + SmartGetFieldShort(TheNPC, hook_animableentity_AreaX2));
TileArea.Y2 := (BaseY + SmartGetFieldShort(TheNPC, hook_animableentity_AreaY2));

Height := IAbs(SmartGetFieldInt(TheNPC, hook_character_Height));
Animation := SmartGetFieldArrayInt(TheNPC, hook_character_AnimationQueue, 1);
Motion := SmartGetFieldInt(TheNPC, hook_character_Motion);
HPRatio := SmartGetFieldInt(TheNPC, hook_character_HPRatio) * 100 / $FF;
InCombat := LoopCycle < SmartGetFieldInt(TheNPC, hook_character_LoopCycleStatus);
WalkQueueX := SmartGetFieldArrayInt(TheNPC, hook_character_WalkQueueX, 0);
WalkQueueY := SmartGetFieldArrayInt(TheNPC, hook_character_WalkQueueY, 0);
Interacting := SmartGetFieldInt(TheNPC, hook_character_Interacting);
Orientation := Round(FixD(180 + (SmartGetFieldInt(TheNPC, hook_character_Orientation)* 45) / 2048));
end;
Inc(C);
finally
SmartFreeObject(TheNPCNode);
SmartFreeObject(TheNPC);
SmartFreeObject(NPCDef);
end;
SetLength(NPCs, C);
Result := R_SortNPCs(NPCs);
end;



^ i want that to make sense to me, just how i learned TPA's/ATPA'S.. I want reflection to work so i can complete tasks so far i couldn't accomplish with color:

- Open the gate at jaitzso without the mouse scrolling all over the place to find the correct uptext.
- Pick up bones at the Ankous room on the fourth floor of the stronghold without scrolling through all the identical colors/sized items in the room.
- Click on the Magic axes at the axe hut - only the alive ones, don't hover the ones that are already dead and on the ground (iron battle axes).

That's basically it, so i need to learn how i can make smart find id's and then convert them to points on the screen then grab the midpoint for x,y then move mouse and click it… Then learn enough to solve randoms and maybe other… Dreams..

rj

2013-09-07 16:08:02

@samerdl I looked at the Reflection include and found this:

https://github.com/SRL/srl-reflection/blob/master/Core/NPCs.simba

type
{Holds information related to an NPC}
TNPC = record
Index, ID, Level, Animation, Height, HPRatio, Interacting,
Orientation: integer;// SOUTH = 0; NORTH = 180; CLOCKWISE.
Tile, RealTile: TTile;
Pixel: TPoint;//Pixel position on tile
Name: String;
Actions: TStringArray;
Moving, Fighting: boolean;
end;

So this function returns an arrow of the record TNPC:

function R_GetNPCsMulti(TheVarArr: TVariantArray; Null: Boolean): TNPCArray;

Each TNPC has these properties: (as defined in the type)
Index - index of the NPC(not really sure what this is :D)
ID - the NPC Id obviously
Level - the NPC combat level
Height - the NPC height
HPRatio - the NPC HPratio
Interacting - no idea TBH
Orientation - the NPC direction (south = 0 and north is 180)
Tile - the tile the NPC is standing on
RealTile - the tile were the NPC spawns I'm guessing
Pixel - Location of the NPC
Name - Name of the NPC
Actions - Options of the NPC
Moving - whether or not the NPC is moving (true/false)
Fighting - whether or not the NPC is fighting (true/false)

You can acess them by doing TNPC and a period. So to see if the NPC fighting you would do like TNPC.Fighting, and it would return true/false

To access the one you want you would have to do a for to do loop to get the one your looking for, for example:
function r_getNPCLocation(npcID:Integer):TPoint;
var
i:Integer;
NPCS:TNPCArray;
begin
NPCS := R_GetNPCsMulti; //gets the info of all the NPCs nearby
for i := 0 to high(NPCS) do //prepares to loop through all of the found NPCs
begin
// if the current index NPCs id is the one you chose and is not in combat
// then the result is the location of that NPC
if ((NPCS[i].ID = npcID) and (NPCS[i].Fighting = false)) then
result := NPCS[i].pixel;
end;
end;

To ultimately understand this I would suggest looking at a records tutorial: http://villavu.com/forum/showthread.php?t=80132


EDIT: here is a quick example sort of (that is related to this situation):

type SRLtype = record
Developer, SuperMod, Admin:TStringArray;
end;

function SRLRanks:SRLtype;
begin
result.Admin := ['Wizzup?', 'Hobbit', 'Benland100', 'Daniel', 'Brak' +
'Coh3n','nielsie95','RAM','WT-Fakawi'];

result.SuperMod := ['YoHoJo','Zyt3x','Justin','MasterBB'];

result.Developer := ['Flight', 'Coh3n', 'Hobbit', 'NCDS', 'n3ss3s' +
'Wizzup?','WT-Fakawi','Zyt3x'];
end;

begin
Writeln(SRLRanks.SuperMod);
end.

As you can see the type "SRLtype" contains Developer, Supermod, and Admin, and the function SRLRanks returns SRLType.

Writeln(SRLranks) will print all of the names
Writeln(SRLranks.Admin) will print the admins
Writeln(SrlTanks.Developer) will print the developers and so on

masterBB

2013-09-07 16:14:35

I've checked them out. All those tutorials are about srl-reflection and not reflection itself.

samerdl

2013-09-08 05:07:44

From: masterBB
I've checked them out. All those tutorials are about srl-reflection and not reflection itself.


that's perfect, better than nothing. Can they be made public or give access to the password please ?

@Officer Barbrady thats perfect thnx for that. Now instead of nagging people every two minutes…i wouldnt wanna nag you or n33s :o

masterBB

2013-09-08 06:12:16

From: samerdl
that's perfect, better than nothing. Can they be made public or give access to the password please ?

@Officer Barbrady thats perfect thnx for that. Now instead of nagging people every two minutes…i wouldnt wanna nag you or n33s :o


should work now:
http://villavu.com/forum/forumdisplay.php?f=377

samerdl

2013-09-08 06:36:09

From: masterBB
should work now:
http://villavu.com/forum/forumdisplay.php?f=377


Your administrator has required a password to access this forum. Please enter this password now.
Note: This requires cookies!

still doesn't work, i tried to guess the password :(

Hoodz, its coming!

masterBB

2013-09-08 06:46:28

From: samerdl
Your administrator has required a password to access this forum. Please enter this password now.
Note: This requires cookies!

still doesn't work, i tried to guess the password :(

Hoodz, its coming!


Yeah, we had a few communication errors on IRC. I had to lock it again like a second after I posted this. Reflection and other client hacking resources probably won't come back.

samerdl

2013-09-08 07:46:13

From: masterBB
Yeah, we had a few communication errors on IRC. I had to lock it again like a second after I posted this. Reflection and other client hacking resources probably won't come back.



Ah well, was worth a shot.

Thank you for your time and help :)

Topic can be closed/deleted, got me answer thanks masterBB