SRL Archive - Help

TReflectLocalPlayer


Davi

2015-05-15 10:12:15

program Test;

{$DEFINE SMART}
{$i AeroLib/AeroLib.Simba}
{$i reflection/Reflection.simba}

var
found : boolean;
reflectPlayer : TReflectLocalPlayer;


begin
initAL();
reflect.Setup;
reflectPlayer.UserName := 'UN';
reflectPlayer.Password := 'pass'; // I have tried replacing this with reflectPlayer.create; same result.
reflectPlayer.Active := True;
reflectPlayer.Login;
writeln(intToStr(reflectPlayer.GetHealth)); // gives 0
repeat
OS_Smart.__Graphics.Clear;
OS_Smart.__Graphics.DrawClippedText(intToStr(reflectPlayer.GetAnimation), 'SmallChars', point(260,150), clWhite); //Always -1
wait(500);
until(found);
end.

Harrier

2015-05-15 10:22:29

Reflecplayer.create;

Davi

2015-05-15 10:28:50

From: Hawker
Reflecplayer.create;


Yeah I tried that already, read the comments :P

Hoodz

2015-05-15 10:33:38

From: Davi
Yeah I tried that already, read the comments :P


try this:

writeln(reflectPlayer.GetSkillLevel(SKILL_HITPOINTS));

you must call reflectPlayer.create; before.

Davi

2015-05-15 10:35:41

From: hoodz
try this:

writeln(reflectPlayer.GetSkillLevel(SKILL_HITPOINTS));

you must call reflectPlayer.create; before.


That works with my current setup with no reflectPlayer.create; however, it's still not grabbing the animations or currentHP correctly. Which is all I really need from this.

Also it was my understanding you use either reflectPlayer.login or reflectPlayer.create from the tutorial.

Harrier

2015-05-15 11:08:10

From: Davi
Yeah I tried that already, read the comments :P

Can't scroll across on my phone :p

Hoodz

2015-05-15 11:16:44

From: Davi
That works with my current setup with no reflectPlayer.create; however, it's still not grabbing the animations or currentHP correctly. Which is all I really need from this.

Also it was my understanding you use either reflectPlayer.login or reflectPlayer.create from the tutorial.


currentHP only works when you are in combat i believe.

what animation are you trying? running/walking is not an animation. (its a separate walk animation)

Davi

2015-05-15 11:58:35

From: hoodz
currentHP only works when you are in combat i believe.

what animation are you trying? running/walking is not an animation. (its a separate walk animation)


The animations when using agility obstacles.

Edit: I discovered the problem - crossing tightropes doesn't register as a change in animation for some reason.

Hoodz

2015-05-15 12:11:00

From: Davi
The animations when using agility obstacles.

Edit: I discovered the problem - crossing tightropes doesn't register as a change in animation for some reason.


its a walk animation.

Davi

2015-05-15 12:39:24

From: hoodz
its a walk animation.


Any good ideas on how to detect when it's using an obstacle?

Hoodz

2015-05-15 13:55:32

From: Davi
Any good ideas on how to detect when it's using an obstacle?


mmh perhaps you can check if your destination is not null.

Davi

2015-05-15 14:08:47

From: hoodz
mmh perhaps you can check if your destination is not null.


What I ended up doing is assigning a delay value for each obstacle (I have it as a custom type) and then after the obstacles delay:


repeat
wait(500);
until(not (player.IsMoving or player.IsAnimating));

It's working very well so far.

Hoodz

2015-05-15 14:41:26

From: Davi
What I ended up doing is assigning a delay value for each obstacle (I have it as a custom type) and then after the obstacles delay:


repeat
wait(500);
until(not (player.IsMoving or player.IsAnimating));

It's working very well so far.


yea i believe player.isMoving checks if the destination is not null, not sure tbh.

Davi

2015-05-15 18:51:02

From: hoodz
yea i believe player.isMoving checks if the destination is not null, not sure tbh.


Ok this is somewhat unrelated. But how do I click on a objWallDecoration? I can get the tile and I can get the object on the tile but the object.MSPoint is not the object. It's the tiles point, which misses the object by a large reason. Originally I was using an if statement to catch wall objects and change the point manually, but now that I've branched out to cover multiple agility courses the offset needs to change, not just depending on my camera angle, but the angle of the wall object.