Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public RSTile examineRandomObject(int scans) {
- RSTile start = getMyPlayer().getLocation();
- for(int h = 1; h < scans * scans; h += 2) {
- for(int i = 0; i < h; i++) {
- for(int j = 0; j < h; j++) {
- int offset = (h + 1)/2 - 1;
- RSTile tile = new RSTile(start.getX() - offset + i, start.getY() - offset + j);
- RSObject obj = getObjectAt(tile);
- if(obj != null) {
- atMenu("xamine");
- log("Examine object");
- break;
- }
- if(i > 0 && i < h - 1) {
- j = h - 1;
- }
- }
- }
- }
- return null;
- }
Add Comment
Please, Sign In to add comment