PDA

View Full Version : TReflectLocalPlayer



Davi
05-15-2015, 02:12 PM
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(refle ctPlayer.GetAnimation), 'SmallChars', point(260,150), clWhite); //Always -1
wait(500);
until(found);
end.

Harrier
05-15-2015, 02:22 PM
Reflecplayer.create;

Davi
05-15-2015, 02:28 PM
Reflecplayer.create;

Yeah I tried that already, read the comments :P

Hoodz
05-15-2015, 02:33 PM
Yeah I tried that already, read the comments :P

try this:

writeln(reflectPlayer.GetSkillLevel(SKILL_HITPOINT S));


you must call reflectPlayer.create; before.

Davi
05-15-2015, 02:35 PM
try this:

writeln(reflectPlayer.GetSkillLevel(SKILL_HITPOINT S));


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
05-15-2015, 03:08 PM
Yeah I tried that already, read the comments :P
Can't scroll across on my phone :p

Hoodz
05-15-2015, 03:16 PM
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
05-15-2015, 03:58 PM
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
05-15-2015, 04:11 PM
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
05-15-2015, 04:39 PM
its a walk animation.

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

Hoodz
05-15-2015, 05:55 PM
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
05-15-2015, 06:08 PM
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
05-15-2015, 06:41 PM
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
05-15-2015, 10:51 PM
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.