Jump to content

Teleporting to GE/Outside of House


Recommended Posts

Posted

Hi the goal is a very simple script. Start at GE -> teleport OUTSIDE of house with empty buckets in inventory. Fill buckets with sand and teleport back to the GE to deposit and repeat. However, there are no teleport to grand exchange or outside house options so I end up teleporting to varrock square or inside my house which is NOT what I want? Any ideas on how to solve this? My script so far:

public final class FaovSand extends Script  {
    @Override
    public final void onStart() {
    }

    @Override
    public final int onLoop() throws InterruptedException {
        getTabs().open(Tab.MAGIC);
        getBank().open();
        getBank().withdrawAll("Bucket");
        getBank().close();
        if (getInventory().contains("Bucket")) {
            magic.castSpell(Spells.NormalSpells.TELEPORT_TO_HOUSE);
        }

        RS2Object sandpit = getObjects().closest("Sandpit");
        getTabs().open(Tab.INVENTORY);
        getInventory().getItem("Bucket").interact("Use");
        if (sandpit != null && sandpit.interact("Use")) {
            MethodProvider.sleep(5000);
        }
        long buckets = getInventory().getAmount("Bucket of sand");
        log(buckets);
        if (getInventory().contains("Bucket of sand") && getInventory().getAmount("Bucket of sand") >= 26) {
            getTabs().open(Tab.MAGIC);
            magic.castSpell(Spells.NormalSpells.VARROCK_TELEPORT);
        }
        return 10000;
    }
}

 

Posted
1 hour ago, Medusaa said:

Does that script actually work? I feel like it'd be much easier for you if you switched to task based scripts, instead of throwing it all in the onLoop method.

It’s so small it really doesn’t matter, however I recommend better checks, and adding verification to booleans to make sure they return true before proceeding

Posted

Sorry this is my first script I'm trying simple things for now but I definitely will implement checks for each step.

 

I CANNOT just change my house to teleport outside because that makes the left click option Outside house and the bot just right clicks and goes inside. Seems kinda counterproductive. Same thing for the GE but I'm not too worried about the bank location, there are other cities. I don't have a ring of wealth on this acc (low level ironman). Can anyone show me example code of right clicking on the spell or clicking on a house portal to exit the house? Thank you.

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...