Jump to content

Open door after teletabbing to house?


Recommended Posts

Posted

This is my code:

        List<RS2Object> doors = this.script.objects.getAll();
        RS2Object theDoor = null;
        Position myDoorCHANGE = new Position(7264, 11595, 0);
 
        for (RS2Object potDoor : doors) {
            if (potDoor.getId() == 13101 && potDoor.getOrientation() == 0
                    && potDoor.getPosition().equals(myDoorCHANGE)) {
                theDoor = potDoor;
                break;
            }
        }
 
        if (theDoor.isVisible()) {
            while (theDoor.exists()) {
                theDoor.interact("Open");
            }
        } else {
            this.script.camera.toEntity(theDoor);
            while (theDoor.exists()) {
                theDoor.interact("Open");
            }
        }
 
but the problem is "theDoor" is null after the for-each method. Wat do?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...