Jump to content

Interaction fails?


Recommended Posts

Posted
                if (!getMagic().isSpellSelected()) {
                    if (getMagic().castSpell(NormalSpells.SUPERHEAT_ITEM)) {
                        new ConditionalSleep(5000) {
                            @Override
                            public boolean condition() throws InterruptedException {
                                return getMagic().isSpellSelected();
                            }
                        }.sleep();
                    }
                } else {
                    long invAmount = getInventory().getAmount("Iron ore");
                    if (getInventory().interact("Cast", "Iron ore")) {
                        new ConditionalSleep(5000) {
                            @Override
                            public boolean condition() throws InterruptedException {
                                return invAmount != getInventory().getAmount("Iron ore");
                            }
                        }.sleep();
                    }
                }

 

I have the above in a script and the interaction occasionally fails. The script will cast a few hundred casts and eventually fail and I am not too sure why.

The script will go on its way and then after a few hundred casts just stops. The spell is selected and the bot is stuck in the inventory hovering the iron ore to interact with it.

Is this an API bug or have I possibly done something that isn't reliable?

 

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