dreameo Posted August 24, 2017 Share Posted August 24, 2017 (edited) try sleep untill my player is animating. (for the fire interact part) What you have, sleep untill inv does not contain raw,// always returns true edit: the way you have it set up, it returns true always, that's why its spamming I think that'll work, if not, rip Edited August 24, 2017 by dreameo 1 Quote Link to comment Share on other sites More sharing options...
d0zza Posted August 24, 2017 Share Posted August 24, 2017 16 minutes ago, kingbutton said: Okay so I got it to chill after it does "Cook all", and technically my code is working smoothly, but there's one thing that is unhuman like and needs to be address. When it tries to interact with the fire, it tries to click several times, kind of like the thing issue I had before. It doesn't bug out or anything, but it bothers me that does it, any solutions? I tried working with the sleep, but it's not working. public class Main extends Script { long lastAnimation = 0; @Override public int onLoop() throws InterruptedException { if (invCheck()) { if (fireCheck()) { log("Go cook"); if (myPlayer().isAnimating()) { lastAnimation = System.currentTimeMillis(); } else if (System.currentTimeMillis() > (lastAnimation + 12000)) { goCook(); } } else { log("Make fire"); makeFire(); } } else { } return 50; } public void goCook() { RS2Object fire = objects.closest("Fire"); RS2Widget optionMenu = getWidgets().get(307, 2); if (inventory.interactWithNameThatContains("Use", "Raw")) { if (optionMenu != null) { if (optionMenu.interact("Cook All")) { new ConditionalSleep(random(3000, 4500)) { @Override public boolean condition() throws InterruptedException { return myPlayer().isAnimating(); } }.sleep(); } } else { if (!myPlayer().isAnimating() && !myPlayer().isMoving()) { if (fire.interact("Use")) { //Sleep.sleepUntil(() -> !getInventory().contains("raw"), 12000); new ConditionalSleep(random(3000, 4500)) { @Override public boolean condition() throws InterruptedException { return myPlayer().isAnimating(); } }.sleep(); } } } } } The sleep you were using after interacting with the fire (the one I commented out in the quote) was returning true right away since your inventory will never contain anything with the exact name "raw". The conditional sleep I replaced it with should work. 1 Quote Link to comment Share on other sites More sharing options...