CLoud Posted August 12, 2018 Share Posted August 12, 2018 (edited) I'm having trouble using conditional sleeps. This is what I have so far which works for Melee but keeps clicking when using ranged. new ConditionalSleep(30000) { public boolean condition() throws InterruptedException { return rat.isUnderAttack(); } }.sleep(); Anyone got any ideas? Would be greatly appreciated! Edited August 12, 2018 by CLoud Quote Link to comment Share on other sites More sharing options...
FuryShark Posted August 12, 2018 Share Posted August 12, 2018 (edited) rat.getHealthPercent() == 0 Edited August 12, 2018 by FuryShark Quote Link to comment Share on other sites More sharing options...
d0zza Posted August 12, 2018 Share Posted August 12, 2018 The way you're going about this is bad, you're making the client sleep until the rat is dead. What happens if you need to eat during this time period? Instead you should be checking for if you're in combat and if not then attack a rat. Quote Link to comment Share on other sites More sharing options...
Lexhanatin Posted August 12, 2018 Share Posted August 12, 2018 Are you trying to sleep after you attempt to attack the rat? 10 minutes ago, d0zza said: The way you're going about this is bad, you're making the client sleep until the rat is dead. How is he sleeping until the rat is dead? It's until the rat is under attack? Quote Link to comment Share on other sites More sharing options...
CLoud Posted August 12, 2018 Author Share Posted August 12, 2018 Works perfect! Thank you! Didnt realize it would be that easy Quote Link to comment Share on other sites More sharing options...
CLoud Posted August 12, 2018 Author Share Posted August 12, 2018 (edited) Sorry didnt see your other responses. 17 minutes ago, d0zza said: The way you're going about this is bad, you're making the client sleep until the rat is dead. What happens if you need to eat during this time period? Instead you should be checking for if you're in combat and if not then attack a rat. Im interacting with the rat and if it's succesful then run the conditional sleep. If not. Try again. 5 minutes ago, Lexhanatin said: Are you trying to sleep after you attempt to attack the rat? How is he sleeping until the rat is dead? It's until the rat is under attack? I'm sleeping until the rat isnt under attack in the original post. Then when it was dead it was no longer under attack. Thus I'd stop sleeping. But it didnt work well with ranged. Edited August 12, 2018 by CLoud Fucked up the order of the quotes. Quote Link to comment Share on other sites More sharing options...