April 1, 20178 yr Can we get a functional sleep that sleeps until event complete so like for firemaking sleepUntil(!myPlayer.isAnimating)); or like gaining experience, etc.. Something like that to have clean easy to use code would be awesome, rather than creating abstract, redundant task handlings for it. Would really appreciate this function for numerous things.
April 1, 20178 yr try using ConditionalSleep or find explv's snippet in the snippet section or create your own method.
April 1, 20178 yr Author I haven't really looked through the API's conditional sleep until animation is reset to stand index. Can someone show me a snippet for conditional sleep till animation is reset please?
April 1, 20178 yr 34 minutes ago, Booleans YAY said: I haven't really looked through the API's conditional sleep until animation is reset to stand index. Can someone show me a snippet for conditional sleep till animation is reset please? new ConditionalSleep(1000, 3000) { public boolean condition() throws InterruptedException { return getInventory().contains("item"); } }.sleep();
April 1, 20178 yr You could also even just use a while function while(myPlayer().isAnimating()){ sleep(random(400, 500)); }
April 1, 20178 yr new ConditionalSleep(10000) { @Override public boolean condition() throws InterruptedException { return !myPlayer().isAnimating(); } }.sleep(); Sleeps for max 10 seconds or until the player is not animating anymore Edited April 1, 20178 yr by Reveance
April 1, 20178 yr I suggest reading @Explv's Scripting 101 Tut: All this plus a lot more useful info can be found there.
April 1, 20178 yr Author I also haven't tried the conditional sleep with animation check since i wrote my first few scripts which one was a firemaking one. I'll review this stuff another day when I get the time. I appreciate the over haul responses from the community.
April 1, 20178 yr 16 hours ago, IDontEvenBot said: new ConditionalSleep(1000, 3000) { public boolean condition() throws InterruptedException { return getInventory().contains("item"); } }.sleep(); no.
April 1, 20178 yr 16 hours ago, Slut said: You could also even just use a while function while(myPlayer().isAnimating()){ sleep(random(400, 500)); } Random is unnecessary and while loops like this should have a timeout.
April 1, 20178 yr 28 minutes ago, Imateamcape said: no. Is there something wrong with it im not seeing?
April 1, 20178 yr 1 minute ago, IDontEvenBot said: Is there something wrong with it im not seeing? Read the ConditionalSleep documentation, your sleep won't do anything.
April 1, 20178 yr 5 minutes ago, Alek said: Read the ConditionalSleep documentation, your sleep won't do anything. Whoooops never actually read what Sleeptime was and assumed it was sleep randomly between X - X LMAO! Thank you for enlightening me.
April 1, 20178 yr 3 minutes ago, IDontEvenBot said: Whoooops never actually read what Sleeptime was and assumed it was sleep randomly between X - X LMAO! Thank you for enlightening me. Don't feel bad, even scripters were screwing this up for a while.
Create an account or sign in to comment