Malcolm Posted January 18, 2019 Share Posted January 18, 2019 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? Quote Link to comment Share on other sites More sharing options...
dreameo Posted January 18, 2019 Share Posted January 18, 2019 Just put a log in the code blocks (each one) and when it gets stuck hovering over the iron ore, you will know where the script is hanging. You might find that it isn't hanging anywhere here and the issue is somewhere else in your code. Quote Link to comment Share on other sites More sharing options...