SRL Archive - Jr. Member General Help and Discussion

OSRS Lape Reflection


Battousai

2015-03-02 23:33:52

Just wondering how come when ever i use the following way of getting a tree, that unless I'm on a certain side of a tree, the mouse does not click on the actual tree.


Procedure findTree;
var
AllObjects: TReflectObjectArray;
OurObject: TReflectObject;
Point: TPoint;
Begin
AllObjects.GetAll(objGame, 20); //Loads all game objects within 20 tiles
AllObjects.Get(objGame, 'Tree', 20);// Loads all 'Tree's within 20 tiles
OurObject.Find(objGame, 'Tree', 20);//Loads nearest 'Tree' and returns true if found within 20 tiles

If OurObject.Find(objGame, 'Tree', 20) Then
Point := Reflect.Tiles.TileToMS(OurObject.GetTile);
ClearDebug;
writeLn('Status: Found Tree');
HumanMMouse(Point, 2, 2);
FastClick(MOUSE_LEFT);

End;

Kyle

2015-03-03 00:10:58

From: Battousai
Just wondering how come when ever i use the following way of getting a tree, that unless I'm on a certain side of a tree, the mouse does not click on the actual tree.


Procedure findTree;
var
AllObjects: TReflectObjectArray;
OurObject: TReflectObject;
Point: TPoint;
Begin
AllObjects.GetAll(objGame, 20); //Loads all game objects within 20 tiles
AllObjects.Get(objGame, 'Tree', 20);// Loads all 'Tree's within 20 tiles
OurObject.Find(objGame, 'Tree', 20);//Loads nearest 'Tree' and returns true if found within 20 tiles

If OurObject.Find(objGame, 'Tree', 20) Then
Point := Reflect.Tiles.TileToMS(OurObject.GetTile);
ClearDebug;
writeLn('Status: Found Tree');
HumanMMouse(Point, 2, 2);
FastClick(MOUSE_LEFT);

End;


Because you are only using the tile to get its location, and most tree's are on four tiles. If you do:

Point := OurObject.GetMSPoint;
HumanMMouse(Point, 2, 2);

That will be 100% accurate :)