zamaro

Object finding

May 31st, 2014
266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. function GetObject(ObjectID: integer; Uptext: string): Boolean;
  2. var
  3. Objects: TRSObjectArray;
  4. Bp, ObjectLoc: Tpoint;
  5. I: integer;
  6. begin
  7. if (not LoggedIn) then
  8. Exit;
  9. Objects := R_GetObjectsDistance(OBJ_GAME, 40);
  10. for I := 0 to high(Objects) do
  11. begin
  12. if (Objects[I].Id = ObjectID) then
  13. begin
  14. ObjectLoc := (Objects[I].tile);
  15. if (R_DistanceFromTile(ObjectLoc) > 5) and (R_DistanceFromTile(ObjectLoc) < 25) then
  16. begin
  17. Bp.x := ObjectLoc.x + 1;
  18. Bp.Y := ObjectLoc.y - 1;
  19. R_WalkPath([Bp]);
  20. end;
  21. ObjectLoc := R_TileToMS(Objects[I].tile);
  22. Mouse(ObjectLoc.X, ObjectLoc.Y, 3, 3, Mouse_move);
  23. if (R_IsUpText(Uptext)) then
  24. begin
  25. result := true;
  26. end;
  27. end;
  28. end;
  29. end;
Advertisement
Add Comment
Please, Sign In to add comment