Guest User

Untitled

a guest
Jul 15th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. public RSTile examineRandomObject(int scans) {
  2. RSTile start = getMyPlayer().getLocation();
  3. for(int h = 1; h < scans * scans; h += 2) {
  4. for(int i = 0; i < h; i++) {
  5. for(int j = 0; j < h; j++) {
  6. int offset = (h + 1)/2 - 1;
  7. RSTile tile = new RSTile(start.getX() - offset + i, start.getY() - offset + j);
  8. RSObject obj = getObjectAt(tile);
  9. if(obj != null) {
  10. atMenu("xamine");
  11. log("Examine object");
  12. break;
  13. }
  14. if(i > 0 && i < h - 1) {
  15. j = h - 1;
  16. }
  17. }
  18. }
  19. }
  20. return null;
  21. }
Add Comment
Please, Sign In to add comment