Package org.rspeer.game.script
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 Summary
Constructors Constructor Description Task()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description intcompareTo(Task other)abstract booleanexecute()TaskgetParent()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.UsesleepUntil(BooleanSupplier, int)with an inverted condition.
-
-
-
Method Detail
-
execute
public abstract boolean execute()
-
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 mettimeout- 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 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 public void sleepWhile(BooleanSupplier condition, int timeout)
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
public Task getParent()
-
compareTo
public int compareTo(Task other)
- Specified by:
compareToin interfaceComparable<Task>
-
-