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;