InventoryBuilder
Builder for creating inventory-related handlers.
ClassRLPlugins API
public class InventoryBuilder extends AbstractHandlerBuilder<InventoryBuilder>Constants
END_EXECUTION
Members
Constructors
- newInventoryBuilder()
Creates a InventoryBuilder.
Methods
- InventoryBuilderdrop(String...)
Drops specified items from the inventory.
- InventoryBuilderget()
Creates a new InventoryBuilder instance.
- InventoryBuilderinteract(String, String)
Interacts with an item in the inventory.
- InventoryBuilderinteract(int, String)
Interacts with an item in the inventory.
- InventoryBuilderinteract(String, String, String)
Interacts with a sub-option of an item in the inventory.
- InventoryBuilderinteract(int, String, String)
Interacts with a sub-option of an item in the inventory.
- InventoryBuilderuseOnItem(int, String, String)
Uses one item on another in the inventory.
- InventoryBuilderuseOnNpc(int, String, String)
Uses an item on an NPC.
- InventoryBuilderuseOnObject(int, String, String)
Uses an item on a tile object.
- InventoryBuilderuseOnPlayer(int, String, String)
Uses an item on a player.
- InventoryBuilderuseOnTileItem(int, String, String)
Uses an item on a tile item.
Inherited from AbstractHandlerBuilder
- InventoryBuilderadd(Consumer<StepContext>)
Adds a step to the handler and assumes to return the next step number.
- InventoryBuilderadd(Function<StepContext, Integer>)
Adds a step to the handler.
- InventoryBuilderadd(Runnable)
Adds a step to the handler and assumes to return the next step number.
- InventoryBuilderadd(Supplier<Integer>)
Adds a step to the handler.
- InventoryBuilderadd(String, Consumer<StepContext>)
Adds a step to the handler and assumes to return the next step number.
- InventoryBuilderadd(String, Function<StepContext, Integer>)
Adds a step to the handler.
- InventoryBuilderadd(String, Runnable)
Adds a step to the handler and assumes to return the next step number.
- InventoryBuilderadd(String, Supplier<Integer>)
Adds a step to the handler.
- InventoryBuilderaddDelay(int)
Adds a delay to the handler.
- InventoryBuilderaddDelay(String, int)
Adds a delay to the handler.
- InventoryBuilderaddDelayUntil(BooleanSupplier)
Adds a delay until a condition is met.
- InventoryBuilderaddDelayUntil(Predicate<StepContext>)
Adds a delay until a condition is met.
- InventoryBuilderaddDelayUntil(String, BooleanSupplier)
Adds a delay until a condition is met.
- InventoryBuilderaddDelayUntil(String, Predicate<StepContext>)
Adds a delay until a condition is met.
- InventoryBuilderaddDelayUntil(int, BooleanSupplier, Runnable)
Adds a delay until a condition is met.
- InventoryBuilderaddDelayUntil(int, Predicate<StepContext>, Consumer<StepContext>)
Adds a delay until a condition is met.
- InventoryBuilderaddDelayUntil(String, int, BooleanSupplier, Runnable)
Adds a delay until a condition is met.
- InventoryBuilderaddDelayUntil(String, int, Predicate<StepContext>, Consumer<StepContext>)
Adds a delay until a condition is met.
- InventoryBuilderappend(HandlerBuilder)
Appends a handler builder to the handler.
- InventoryBuilderappend(StepHandler)
Appends a step handler to the handler.
- InventoryBuilderappend(String, HandlerBuilder)
Appends a handler builder to the handler.
- InventoryBuilderappend(String, StepHandler)
Appends a step handler to the handler.
- InventoryBuilderwalkTo(WorldArea)
Adds a walk to step to the handler.
- InventoryBuilderwalkTo(WorldPoint)
Adds a walk to step to the handler.
- InventoryBuilderwalkTo(String, WorldArea)
Adds a walk to step to the handler.
- InventoryBuilderwalkTo(String, WorldPoint)
Adds a walk to step to the handler.
- InventoryBuilderwalkToWorldAreaSupplier(Supplier<WorldArea>)
Adds a walk to step to the handler.
- InventoryBuilderwalkToWorldAreaSupplier(String, Supplier<WorldArea>)
Adds a walk to step to the handler.
- InventoryBuilderwalkToWorldPointSupplier(Supplier<WorldPoint>)
Adds a walk to step to the handler.
- InventoryBuilderwalkToWorldPointSupplier(String, Supplier<WorldPoint>)
Adds a walk to step to the handler.
Inherited from HandlerBuilder
- HandlerBuilderadd(int, Consumer<StepContext>)
Adds a step to the handler and assumes to return the next step number.
- HandlerBuilderadd(int, Function<StepContext, Integer>)
Adds a step to the handler.
- HandlerBuilderadd(int, Runnable)
Adds a step to the handler and assumes to return the next step number.
- HandlerBuilderadd(int, Supplier<Integer>)
Adds a step to the handler.
- HandlerBuilderaddDelay(int, int)
Adds a delay to the handler.
- HandlerBuilderaddDelayUntil(int, BooleanSupplier)
Adds a delay until a condition is met.
- HandlerBuilderaddDelayUntil(int, Predicate<StepContext>)
Adds a delay until a condition is met.
- HandlerBuilderaddDelayUntil(int, int, BooleanSupplier, Runnable)
Adds a delay until a condition is met.
- HandlerBuilderaddDelayUntil(int, int, Predicate<StepContext>, Consumer<StepContext>)
Adds a delay until a condition is met.
- HandlerBuilderappend(int, HandlerBuilder)
Append.
- HandlerBuilderappend(int, StepHandler)
Append.
- StepHandlerblank()
Blank.
- StepHandlerbuild()
Builds the TransportHandler.
- HandlerBuilderget()
Creates a new HandlerBuilder.
- int
- voidspeedUp(StepContext)
Speed up.
- HandlerBuilderwalkTo(int, WorldArea)
Walk to.
- HandlerBuilderwalkTo(int, WorldPoint)
Walk to.
- HandlerBuilderwalkToWorldAreaSupplier(int, Supplier<WorldArea>)
Walk to world area supplier.
- HandlerBuilderwalkToWorldPointSupplier(int, Supplier<WorldPoint>)
Walk to world point supplier.
InventoryBuilder()
public InventoryBuilder()Creates a InventoryBuilder.
drop(String...)
public InventoryBuilder drop(String... itemNames)Drops specified items from the inventory.
Parameters
itemNames- Names of the items to drop.
Returns
InventoryBuilder instance.
get()static
public static InventoryBuilder get()Creates a new InventoryBuilder instance.
Returns
A new InventoryBuilder.
interact(String, String)
public InventoryBuilder interact(String itemName, String action)Interacts with an item in the inventory.
Parameters
itemName- Item name.
action- Action to perform.
Returns
InventoryBuilder instance.
interact(int, String)
public InventoryBuilder interact(int itemId, String action)Interacts with an item in the inventory.
Parameters
itemId- Item ID.
action- Action to perform.
Returns
InventoryBuilder instance.
interact(String, String, String)
public InventoryBuilder interact(String itemName, String menu, String action)Interacts with a sub-option of an item in the inventory.
Parameters
itemName- Item name.
menu- Menu option.
action- Action to perform.
Returns
InventoryBuilder instance.
interact(int, String, String)
public InventoryBuilder interact(int itemId, String menu, String action)Interacts with a sub-option of an item in the inventory.
Parameters
itemId- Item ID.
menu- Menu option.
action- Action to perform.
Returns
InventoryBuilder instance.
useOnItem(int, String, String)
public InventoryBuilder useOnItem(int delay, String itemName1, String itemName2)Uses one item on another in the inventory.
Parameters
delay- Delay after the action.
itemName1- Name of the first item.
itemName2- Name of the second item.
Returns
InventoryBuilder instance.
useOnNpc(int, String, String)
public InventoryBuilder useOnNpc(int delay, String itemName, String npcName)Uses an item on an NPC.
Parameters
delay- Delay after the action.
itemName- Name of the item in inventory.
npcName- Name of the NPC.
Returns
InventoryBuilder instance.
useOnObject(int, String, String)
public InventoryBuilder useOnObject(int delay, String itemName, String objectName)Uses an item on a tile object.
Parameters
delay- Delay after the action.
itemName- Name of the item in inventory.
objectName- Name of the tile object.
Returns
InventoryBuilder instance.
useOnPlayer(int, String, String)
public InventoryBuilder useOnPlayer(int delay, String itemName, String playerName)Uses an item on a player.
Parameters
delay- Delay after the action.
itemName- Name of the item in inventory.
playerName- Name of the player.
Returns
InventoryBuilder instance.
useOnTileItem(int, String, String)
public InventoryBuilder useOnTileItem(int delay, String itemName, String tileItemName)Uses an item on a tile item.
Parameters
delay- Delay after the action.
itemName- Name of the item in inventory.
tileItemName- Name of the tile item.
Returns
InventoryBuilder instance.
add(Consumer<StepContext>)from AbstractHandlerBuilder
public InventoryBuilder add(Consumer<StepContext> consumer)Adds a step to the handler and assumes to return the next step number.
Parameters
consumer- The runnable to run.
Returns
The HandlerBuilder.
add(Function<StepContext, Integer>)from AbstractHandlerBuilder
public InventoryBuilder add(Function<StepContext, Integer> function)Adds a step to the handler.
Parameters
function- The function that returns the next step number.
Returns
The HandlerBuilder.
add(Runnable)from AbstractHandlerBuilder
public InventoryBuilder add(Runnable runnable)Adds a step to the handler and assumes to return the next step number.
Parameters
runnable- The runnable to run.
Returns
The HandlerBuilder.
add(Supplier<Integer>)from AbstractHandlerBuilder
public InventoryBuilder add(Supplier<Integer> supplier)Adds a step to the handler.
Parameters
supplier- The supplier that returns the next step number.
Returns
The HandlerBuilder.
add(String, Consumer<StepContext>)from AbstractHandlerBuilder
public InventoryBuilder add(String label, Consumer<StepContext> consumer)Adds a step to the handler and assumes to return the next step number.
Parameters
label- The label for the step.
consumer- The runnable to run.
Returns
The HandlerBuilder.
add(String, Function<StepContext, Integer>)from AbstractHandlerBuilder
public InventoryBuilder add(String label, Function<StepContext, Integer> function)Adds a step to the handler.
Parameters
label- The label for the step.
function- The function that returns the next step number.
Returns
The HandlerBuilder.
add(String, Runnable)from AbstractHandlerBuilder
public InventoryBuilder add(String label, Runnable runnable)Adds a step to the handler and assumes to return the next step number.
Parameters
label- The label for the step.
runnable- The runnable to run.
Returns
The HandlerBuilder.
add(String, Supplier<Integer>)from AbstractHandlerBuilder
public InventoryBuilder add(String label, Supplier<Integer> supplier)Adds a step to the handler.
Parameters
label- The label for the step.
supplier- The supplier that returns the next step number.
Returns
The HandlerBuilder.
addDelay(int)from AbstractHandlerBuilder
public InventoryBuilder addDelay(int delay)Adds a delay to the handler.
Parameters
delay- The delay in steps.
Returns
The HandlerBuilder.
addDelay(String, int)from AbstractHandlerBuilder
public InventoryBuilder addDelay(String label, int delay)Adds a delay to the handler.
Parameters
label- The label for the step.
delay- The delay in steps.
Returns
The HandlerBuilder.
addDelayUntil(BooleanSupplier)from AbstractHandlerBuilder
public InventoryBuilder addDelayUntil(BooleanSupplier condition)Adds a delay until a condition is met.
Parameters
condition- The condition to meet.
Returns
The HandlerBuilder.
addDelayUntil(Predicate<StepContext>)from AbstractHandlerBuilder
public InventoryBuilder addDelayUntil(Predicate<StepContext> condition)Adds a delay until a condition is met.
Parameters
condition- The condition to meet.
Returns
The HandlerBuilder.
addDelayUntil(String, BooleanSupplier)from AbstractHandlerBuilder
public InventoryBuilder addDelayUntil(String label, BooleanSupplier condition)Adds a delay until a condition is met.
Parameters
label- The label for the step.
condition- The condition to meet.
Returns
The HandlerBuilder.
addDelayUntil(String, Predicate<StepContext>)from AbstractHandlerBuilder
public InventoryBuilder addDelayUntil(String label, Predicate<StepContext> condition)Adds a delay until a condition is met.
Parameters
label- The label for the step.
condition- The condition to meet.
Returns
The HandlerBuilder.
addDelayUntil(int, BooleanSupplier, Runnable)from AbstractHandlerBuilder
public InventoryBuilder addDelayUntil(int timeout, BooleanSupplier condition, Runnable onTimeout)Adds a delay until a condition is met.
Parameters
timeout- The timeout in steps.
condition- The condition to meet.
onTimeout- The action to perform on timeout.
Returns
The HandlerBuilder.
addDelayUntil(int, Predicate<StepContext>, Consumer<StepContext>)from AbstractHandlerBuilder
public InventoryBuilder addDelayUntil(int timeout, Predicate<StepContext> condition, Consumer<StepContext> onTimeout)Adds a delay until a condition is met.
Parameters
timeout- The timeout in steps.
condition- The condition to meet.
onTimeout- The action to perform on timeout.
Returns
The HandlerBuilder.
addDelayUntil(String, int, BooleanSupplier, Runnable)from AbstractHandlerBuilder
public InventoryBuilder addDelayUntil(String label, int timeout, BooleanSupplier condition, Runnable onTimeout)Adds a delay until a condition is met.
Parameters
label- The label for the step.
timeout- The timeout in steps.
condition- The condition to meet.
onTimeout- The action to perform on timeout.
Returns
The HandlerBuilder.
addDelayUntil(String, int, Predicate<StepContext>, Consumer<StepContext>)from AbstractHandlerBuilder
public InventoryBuilder addDelayUntil(String label, int timeout, Predicate<StepContext> condition, Consumer<StepContext> onTimeout)Adds a delay until a condition is met.
Parameters
label- The label for the step.
timeout- The timeout in steps.
condition- The condition to meet.
onTimeout- The action to perform on timeout.
Returns
The HandlerBuilder.
append(HandlerBuilder)from AbstractHandlerBuilder
public InventoryBuilder append(HandlerBuilder builder)Appends a handler builder to the handler.
Parameters
builder- The handler builder to append.
Returns
The HandlerBuilder.
append(StepHandler)from AbstractHandlerBuilder
public InventoryBuilder append(StepHandler handler)Appends a step handler to the handler.
Parameters
handler- The step handler to append.
Returns
The HandlerBuilder.
append(String, HandlerBuilder)from AbstractHandlerBuilder
public InventoryBuilder append(String label, HandlerBuilder builder)Appends a handler builder to the handler.
Parameters
label- The label for the step.
builder- The handler builder to append.
Returns
The HandlerBuilder.
append(String, StepHandler)from AbstractHandlerBuilder
public InventoryBuilder append(String label, StepHandler handler)Appends a step handler to the handler.
Parameters
label- The label for the step.
handler- The step handler to append.
Returns
The HandlerBuilder.
walkTo(WorldArea)from AbstractHandlerBuilder
public InventoryBuilder walkTo(WorldArea location)Adds a walk to step to the handler.
Parameters
location- The location to walk to.
Returns
The HandlerBuilder.
walkTo(WorldPoint)from AbstractHandlerBuilder
public InventoryBuilder walkTo(WorldPoint location)Adds a walk to step to the handler.
Parameters
location- The location to walk to.
Returns
The HandlerBuilder.
walkTo(String, WorldArea)from AbstractHandlerBuilder
public InventoryBuilder walkTo(String label, WorldArea location)Adds a walk to step to the handler.
Parameters
label- The label for the step.
location- The location to walk to.
Returns
The HandlerBuilder.
walkTo(String, WorldPoint)from AbstractHandlerBuilder
public InventoryBuilder walkTo(String label, WorldPoint location)Adds a walk to step to the handler.
Parameters
label- The label for the step.
location- The location to walk to.
Returns
The HandlerBuilder.
walkToWorldAreaSupplier(Supplier<WorldArea>)from AbstractHandlerBuilder
public InventoryBuilder walkToWorldAreaSupplier(Supplier<WorldArea> location)Adds a walk to step to the handler.
Parameters
location- The location to walk to.
Returns
The HandlerBuilder.
walkToWorldAreaSupplier(String, Supplier<WorldArea>)from AbstractHandlerBuilder
public InventoryBuilder walkToWorldAreaSupplier(String label, Supplier<WorldArea> location)Adds a walk to step to the handler.
Parameters
label- The label for the step.
location- The location to walk to.
Returns
The HandlerBuilder.
walkToWorldPointSupplier(Supplier<WorldPoint>)from AbstractHandlerBuilder
public InventoryBuilder walkToWorldPointSupplier(Supplier<WorldPoint> location)Adds a walk to step to the handler.
Parameters
location- The location to walk to.
Returns
The HandlerBuilder.
walkToWorldPointSupplier(String, Supplier<WorldPoint>)from AbstractHandlerBuilder
public InventoryBuilder walkToWorldPointSupplier(String label, Supplier<WorldPoint> location)Adds a walk to step to the handler.
Parameters
label- The label for the step.
location- The location to walk to.
Returns
The HandlerBuilder.
add(int, Consumer<StepContext>)from HandlerBuilder
public HandlerBuilder add(int step, Consumer<StepContext> consumer)Adds a step to the handler and assumes to return the next step number.
Parameters
step- The step number.
consumer- The runnable to run.
Returns
The HandlerBuilder.
add(int, Function<StepContext, Integer>)from HandlerBuilder
public HandlerBuilder add(int step, Function<StepContext, Integer> function)Adds a step to the handler.
Parameters
step- The step number.
function- The function that returns the next step number.
Returns
The HandlerBuilder.
add(int, Runnable)from HandlerBuilder
public HandlerBuilder add(int step, Runnable runnable)Adds a step to the handler and assumes to return the next step number.
Parameters
step- The step number.
runnable- The runnable to run.
Returns
The HandlerBuilder.
add(int, Supplier<Integer>)from HandlerBuilder
public HandlerBuilder add(int step, Supplier<Integer> supplier)Adds a step to the handler.
Parameters
step- The step number.
supplier- The supplier that returns the next step number.
Returns
The HandlerBuilder.
addDelay(int, int)from HandlerBuilder
public HandlerBuilder addDelay(int step, int delay)Adds a delay to the handler.
Parameters
step- The step number.
delay- The delay in steps.
Returns
The HandlerBuilder.
addDelayUntil(int, BooleanSupplier)from HandlerBuilder
public HandlerBuilder addDelayUntil(int step, BooleanSupplier condition)Adds a delay until a condition is met.
Parameters
step- The step number.
condition- The condition to meet.
Returns
The HandlerBuilder.
addDelayUntil(int, Predicate<StepContext>)from HandlerBuilder
public HandlerBuilder addDelayUntil(int step, Predicate<StepContext> condition)Adds a delay until a condition is met.
Parameters
step- The step number.
condition- The condition to meet.
Returns
The HandlerBuilder.
addDelayUntil(int, int, BooleanSupplier, Runnable)from HandlerBuilder
public HandlerBuilder addDelayUntil(int step, int timeout, BooleanSupplier condition, Runnable onTimeout)Adds a delay until a condition is met.
Parameters
step- The step number.
timeout- Timeout.
condition- The condition to meet.
onTimeout- On timeout.
Returns
The HandlerBuilder.
addDelayUntil(int, int, Predicate<StepContext>, Consumer<StepContext>)from HandlerBuilder
public HandlerBuilder addDelayUntil(int step, int timeout, Predicate<StepContext> condition, Consumer<StepContext> onTimeout)Adds a delay until a condition is met.
Parameters
step- The step number.
timeout- Timeout.
condition- The condition to meet.
onTimeout- On timeout.
Returns
The HandlerBuilder.
append(int, HandlerBuilder)from HandlerBuilder
public HandlerBuilder append(int step, HandlerBuilder builder)Append.
Parameters
step- Step.
builder- Builder.
append(int, StepHandler)from HandlerBuilder
public HandlerBuilder append(int step, StepHandler handler)Append.
Parameters
step- Step.
handler- Handler.
blank()staticfrom HandlerBuilder
public static StepHandler blank()Blank.
build()from HandlerBuilder
public StepHandler build()Builds the TransportHandler.
Returns
The TransportHandler.
get()staticfrom HandlerBuilder
public static HandlerBuilder get()Creates a new HandlerBuilder.
Returns
The HandlerBuilder.
jump(String, StepContext)staticfrom HandlerBuilder
public static int jump(String label, StepContext context)Jump.
Parameters
label- Label.
context- Context.
speedUp(StepContext)staticfrom HandlerBuilder
public static void speedUp(StepContext context)Speed up.
Parameters
context- Context.
walkTo(int, WorldArea)from HandlerBuilder
public HandlerBuilder walkTo(int step, WorldArea location)Walk to.
Parameters
step- Step.
location- Location.
walkTo(int, WorldPoint)from HandlerBuilder
public HandlerBuilder walkTo(int step, WorldPoint location)Walk to.
Parameters
step- Step.
location- Location.
walkToWorldAreaSupplier(int, Supplier<WorldArea>)from HandlerBuilder
public HandlerBuilder walkToWorldAreaSupplier(int step, Supplier<WorldArea> locationSupplier)Walk to world area supplier.
Parameters
step- Step.
locationSupplier- Location supplier.
walkToWorldPointSupplier(int, Supplier<WorldPoint>)from HandlerBuilder
public HandlerBuilder walkToWorldPointSupplier(int step, Supplier<WorldPoint> locationSupplier)Walk to world point supplier.
Parameters
step- Step.
locationSupplier- Location supplier.
Also allowed
Every class has these, as in plain Java.
equals, toString