Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private boolean openDoor(int doorID) {
- final RSObject door = getNearestObjectByID(doorID);
- if (door == null) {
- return false;
- }
- final RSTile loc = door.getLocation();
- final RSTile counter = new RSTile(loc.getX() + 1, loc.getY());
- int i = 0;
- while (i < 20) {
- i++;
- if (i % 5 == 0) {
- setCameraRotation(random(0, 359));
- }
- final Point midpoint = new Point(
- (int) ((Calculations.tileToScreen(loc).getX() + Calculations
- .tileToScreen(counter).getX()) / 2),
- (int) ((Calculations.tileToScreen(loc).getY() + Calculations
- .tileToScreen(counter).getY()) / 2));
- moveMouse(midpoint, (int) (midpoint.getX() - Calculations
- .tileToScreen(loc).getX()), 5);
- wait(random(300, 500));
- try {
- for (final String s : getMenuActions()) {
- if (s.contains("pen")) {
- final boolean b = atMenu("Open");
- wait(random(600, 1200));
- return b;
- }
- }
- } catch (final NullPointerException noMenuActions) {
- return false;
- }
- }
- return false;
- }
Add Comment
Please, Sign In to add comment