booya Posted April 13 Share Posted April 13 Doing a quest script, currently need to kill a rat for meat to burn it. i just want it to sleep until it sees meat on floor then pick it. but currently, it is returning true on everything ive tried for when on combat in rat, it seems to be if the rats far away..... I have tried every combo you can think of but it skips and comes back to "AT RATS" ive tried || and &&................. anoyying. Quote if (!players.myPlayer().isMoving() && RATS.contains(myPosition())) { log("AT RATS"); sleep(random(500, 1250)); if (!players.myPlayer().isAnimating() && !players.myPlayer().isMoving() && npcs.closest("Giant rat") != null && RATS.contains(myPosition())) { npcs.closest("Giant rat").interact("Attack"); log("ATTACKING RAT"); sleep(random(500,1200)); mouse.moveOutsideScreen(); log("MOVE MOUSE OF SCREEN & SLEEPING"); new ConditionalSleep(120000, 500) { @Override public boolean condition() { log("INCOMBAT3"); return !getPlayers().myPlayer().isMoving() || !getPlayers().myPlayer().isInteracting(getNpcs().closest("Giant Rat")) || !getCombat().isFighting(); } }.sleep(); } if (groundItems.closest("Raw rat meat") != null) { log("RAW MEAT IS ON FLOOR"); groundItems.closestThatContains("Raw rat meat").interact("Take"); sleep(random(200, 800)); new ConditionalSleep(6000) { @Override public boolean condition() throws InterruptedException { return inventory.contains("Raw rat meat"); } }.sleep(); } if (getInventory().contains("Raw rat meat")) { sleep(random(500, 1250)); Onion(); } else { sleep(random(200, 800)); Meat(); Quote Link to comment Share on other sites More sharing options...
Czar Posted April 14 Share Posted April 14 Need to put the block of code checking for ground items, just below "AT RATS" so it takes priority over every action Quote Link to comment Share on other sites More sharing options...
yfoo Posted April 19 Share Posted April 19 When a npc is killed, its loot doesn't appear immediately. Death animation plays first. Change if (groundItems.closest("Raw rat meat") != null) { To a ConditionalSleep, sleep until you see your raw meat drop. Quote Link to comment Share on other sites More sharing options...