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
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintabstract booleanexecute()voidsleep(int ticks) voidsleepUntil(BooleanSupplier condition, int timeout) Sets a conditional sleep to take place after this task executesvoidsleepUntil(BooleanSupplier condition, BooleanSupplier reset, int timeout) Sets a conditional sleep to take place after this task executesvoidsleepWhile(BooleanSupplier condition, int timeout) Deprecated.voidwake()Clears any active sleep
-
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
Sets a conditional sleep to take place after this task executes- Parameters:
condition- The condition of which to sleep until it's mettimeout- The number of ticks to timeout at if the condition never passes
-
sleepUntil
Sets a conditional sleep to take place after this task executes- Parameters:
condition- The condition of which to sleep until it's metreset- A condition that's checked every tick and if met, the sleep is resettimeout- The number of ticks to timeout at if the condition never passes
-
sleepWhile
Deprecated.UsesleepUntil(BooleanSupplier, int)with an inverted condition. Maintaining this function as well as other overloads is bloatSets a conditional sleep to take place after this task executes- Parameters:
condition- The condition of which to sleep while it's mettimeout- The number of ticks to timeout at if the condition never fails
-
getParent
-
compareTo
- Specified by:
compareToin interfaceComparable<Task>
-
sleepUntil(BooleanSupplier, int)with an inverted condition.