5uck Posted October 1, 2013 Posted October 1, 2013 New java class (call it what you want) public class NAMEHEREConditionalSleep extends ConditionalSleep { private final Script SCRIPT; public NAMEHEREConditionalSleep(int arg0, Script script) { super(arg0); this.SCRIPT = script; } @Override public boolean condition() { return CONDITION HERE(If this is true, it will sleep.); } } An example of a somthing to put in CONDITION HERE would be return client.getMyPlayer().isAnimating(); Now whenever you call you conditional sleep, and your playing is animating, it will sleep until he stops animating. Hope this helped! enjoy!
a goat Posted October 1, 2013 Posted October 1, 2013 Finally thanks man i know you saw my question lol
a goat Posted October 1, 2013 Posted October 1, 2013 Can you read my thread again i have another question
Anon Posted October 1, 2013 Posted October 1, 2013 There is already something in the API that maxi made for this.. Looks identical :P
Cyro Posted October 1, 2013 Posted October 1, 2013 There is already something in the API that maxi made for this.. Looks identical :P I think he's extending the conditionSleep from the api
LifezHatred Posted October 1, 2013 Posted October 1, 2013 Use it like so. New java class (call it what you want)public class NAMEHEREConditionalSleep extends ConditionalSleep {private final Script SCRIPT;public NAMEHEREConditionalSleep(int arg0, Script script) {super(arg0);this.SCRIPT = script;}@Overridepublic boolean condition() {return CONDITION HERE(If this is true, it will sleep.);}}An example of a somthing to put in CONDITION HERE would be return client.getMyPlayer().isAnimating();Now whenever you call you conditional sleep, and your playing is animating, it will sleep until he stops animating. A new class isn't needed... very inefficient and doesn't follow oop as for the doesnt follow loop part, it is only called from within the loop, so yeah it does follow the loop. Dumbass oop stands for Object-orientated programming, why don't you learn it? might aswell continue it here
LifezHatred Posted October 1, 2013 Posted October 1, 2013 (edited) Simplified public void sleepCondition(boolean condition, int sleepTime) { while(condition) { sleep(sleepTime); } } Tho still wondering why you would need this Edited October 1, 2013 by LifezHatred
Pseudo Posted October 1, 2013 Posted October 1, 2013 (edited) Simplified public void sleepCondition(boolean condition, int sleepTime) { while(condition) { sleep(sleepTime); } } Tho still wondering why you would need this What if the condition was never to return false? Enjoy doing nothing endlessly. Also, why would you not finalize your objects? Also, why should the condition has to be a boolean, why can't it be something else, such as a numerical value? Edited October 1, 2013 by Pseudo
LifezHatred Posted October 1, 2013 Posted October 1, 2013 (edited) DELETE>>>>>>>>>>>>>>> Edited October 4, 2013 by LifezHatred
LifezHatred Posted October 1, 2013 Posted October 1, 2013 (edited) >>>>>>>>>>>>>>>DELETE<<<<<<<<<<<<<<<<<<<< Edited October 4, 2013 by LifezHatred
Mysteryy Posted October 1, 2013 Posted October 1, 2013 (edited) Use it like so. New java class (call it what you want)public class NAMEHEREConditionalSleep extends ConditionalSleep { private final Script SCRIPT; public NAMEHEREConditionalSleep(int arg0, Script script) { super(arg0); this.SCRIPT = script; } @Override public boolean condition() { return CONDITION HERE(If this is true, it will sleep.); } } An example of a somthing to put in CONDITION HERE would be return client.getMyPlayer().isAnimating(); Now whenever you call you conditional sleep, and your playing is animating, it will sleep until he stops animating. A new class isn't needed... very inefficient and doesn't follow oopas for the doesnt follow loop part, it is only called from within the loop, so yeah it does follow the loop.Dumbass oop stands for Object-orientated programming, why don't you learn it?might aswell continue it here He never asked for anything related to oop. He simply asked fora code like the one 5uck gave. By nature java is an oop language, it doesn't matter if he used objects here or not. Sooo learn2geteducation before trying to act like you know anything about anything.Lol your joking right? i did this because he came n commented on my shiti never asked for his opinion on my shit Do you know the concept behind OOP? creating a new class for each check definitely does not follow an OOP design or isn't organized "He never asked for anything related to oop", this should be expected when releasing java code You should realize that classes are part of Java making them part of oop. You think your methods are better and he thinks his are better. He has multiple very successful scripts, so I would follow his over yours. If it works it works. Get over it.Omg are you serious? OOP is a programming concept that you take into consideration when writing a java programjust because java is a object-orientated programing language doesn't mean that the concept should be thrown out Why don't you learn what i'm talking about before you comment back with ignorant replies. i never said my method was better than his i simply simplified what he has and said what he is doing is completely unneccassary Lolol someone doesn't like to be wrong. Objects of the same orientation or purpose should be classed together, try n learn what the factory concept in java is then come backLolol. Do you even know how to make an object? Do you even know what object attributes are? Have you even heard of an object constructor?Get a brain then come back. Edited October 1, 2013 by Mysteryy
Celeos Posted October 2, 2013 Posted October 2, 2013 This is REALLY basic. May as well use the method included in the API.