Class Task

java.lang.Object
org.rspeer.game.script.Task
All Implemented Interfaces:
Comparable<Task>
Direct Known Subclasses:
BankPinSituation.HandlerTask, DeathWalkSituation.HandlerTask, InterruptiveInterfaceSituationTrigger.HandlerTask, LobbySituation.HandlerTask, RestockTask, SettingsSituation.HandlerTask, WorldMapWalkSituation.HandlerTask

public abstract class Task extends Object implements Comparable<Task>
  • Constructor Details

    • Task

      public Task()
  • Method Details

    • execute

      public abstract boolean execute()
    • wake

      public void wake()
      Clears any active sleep
    • sleep

      public void sleep(int ticks)
      Parameters:
      ticks - Sets the amount of ticks to sleep after this task executes before executing it again. The default is 1, so sleep(1) does nothing
    • sleepUntil

      public void sleepUntil(BooleanSupplier condition, int timeout)
      Sets a conditional sleep to take place after this task executes
      Parameters:
      condition - The condition of which to sleep until it's met
      timeout - The number of ticks to timeout at if the condition never passes
    • sleepUntil

      public void sleepUntil(BooleanSupplier condition, BooleanSupplier reset, int timeout)
      Sets a conditional sleep to take place after this task executes
      Parameters:
      condition - The condition of which to sleep until it's met
      reset - A condition that's checked every tick and if met, the sleep is reset
      timeout - The number of ticks to timeout at if the condition never passes
    • sleepWhile

      @Deprecated public void sleepWhile(BooleanSupplier condition, int timeout)
      Deprecated.
      Use sleepUntil(BooleanSupplier, int) with an inverted condition. Maintaining this function as well as other overloads is bloat
      Sets a conditional sleep to take place after this task executes
      Parameters:
      condition - The condition of which to sleep while it's met
      timeout - The number of ticks to timeout at if the condition never fails
    • getParent

      public Task getParent()
    • compareTo

      public int compareTo(Task other)
      Specified by:
      compareTo in interface Comparable<Task>