Jump to content

Botre

Members
  • Posts

    5883
  • Joined

  • Last visited

  • Days Won

    18
  • Feedback

    100%

Everything posted by Botre

  1. Botre

    3k

    For some reason this: turned me on. ...
  2. “You know what happened – the question is, can you live with it?
  3. To detect the client they need access to the JVM, that's why the mirror client runs on its own JVM. ... I think.
  4. PM me if you'd like to collaborate on the script
  5. Botre

    prayer

    Wrong section Use scripting help next time you need help ^^. (also: what precise said and gl)
  6. Different operating systems run different JVMs though.
  7. another thread bites the dust
  8. Some have points. Others have more than one neuron... ... because that's pretty much all it takes to understand the rules of OSB... ... 2 neurons. <- anyone with warning points.
  9. Threads targeting another user will be judged upon by the moderator, if you feel your thread was closed and wasn't supposed to be pm Maldesto. (There will be no targeting staff) ... if you feel your thread was closed and wasn't supposed to be pm Maldesto. ... pm Maldesto. ... Maldesto ...
  10. Botre

    nop

    You need 100 posts to sell accounts and this is only allowed in the appropriate section. Please read the rules: http://osbot.org/forum/topic/64221-rules/
  11. A quick example of a ConditionalSleep class. The API one is great and I suggest you use that one, this is more for learning purposes. package org.bjornkrols.conditional; import org.bjornkrols.imported.MilliTimer; /** * @author Bjorn Krols (Botre) * @version 0.1 * @since March 16, 2015 */ public abstract class ConditionalSleep { /** * The time in milliseconds to sleep for per loop. */ private final int sleep; /** * The maximum (exclusive) time of sleep, in milliseconds, after which the sleep loop will be broken. */ private final int timeout; /** * @param sleep The time in milliseconds to sleep for per loop. * @param timeout The maximum (exclusive) time of sleep in milliseconds after which the sleep loop will be broken. */ public ConditionalSleep(final int sleep, final int timeout) { this.sleep = sleep; this.timeout = timeout; } /** * @return Whether to continue to sleep. */ public abstract boolean condition(); /** * Sleeps until the condition returns false or the timeout is reached. */ public void sleep() { MilliTimer timer = new MilliTimer(); while (condition() && timer.getElapsedMilliSeconds() < timeout) { try { Thread.sleep(sleep); } catch (InterruptedException e) { e.printStackTrace(); } } } } Implementation example: // Wait while moving or making fire. new ConditionalSleep(300, 5000) { @Override public boolean condition() { return script.myPlayer().isMoving() || script.myPlayer().getAnimation() == FIREMAKING_ANIMATION; } }.sleep();
×
×
  • Create New...