Jump to content

Interaction fails?


Malcolm

Recommended Posts

                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?

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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