Package org.tribot.script.sdk.interfaces
Interface Interactable
-
- All Superinterfaces:
Clickable
,Positionable
- All Known Implementing Classes:
GameObject
,GroundItem
,LocalTile
,Npc
,Player
,WorldTile
public interface Interactable extends Positionable, Clickable
Represents an "interactable" entity. This is an entity that is both positionable (has a position), and clickable.
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default boolean
interact(java.lang.String action)
Attempts to interact with the entity using the given action.default boolean
interact(java.lang.String action, java.util.function.BooleanSupplier interruptCondition)
Attempts to interact with the entity using the given action.-
Methods inherited from interface org.tribot.script.sdk.interfaces.Clickable
click, click, hover, hover, hoverMenu, isHovering, isVisible
-
Methods inherited from interface org.tribot.script.sdk.interfaces.Positionable
adjustCameraTo, distance, distanceTo, getTile
-
-
-
-
Method Detail
-
interact
default boolean interact(java.lang.String action)
Attempts to interact with the entity using the given action. This method will adjust the camera to and walk to the entity if needed. As of now, the interactable entity must be reachable. In the future, support for obstacles such as doors may be added.- Parameters:
action
- The action to use when interacting with the entity (IE: "Attack", "Take", etc)- Returns:
- True if the entity was clicked, false otherwise
-
interact
default boolean interact(java.lang.String action, java.util.function.BooleanSupplier interruptCondition)
Attempts to interact with the entity using the given action. This method will adjust the camera to and walk to the entity if needed. As of now, the interactable entity must be reachable. In the future, support for obstacles such as doors may be added.- Parameters:
action
- The action to use when interacting with the entity (IE: "Attack", "Take", etc)interruptCondition
- a condition to interrupt the interaction attempt - if this condition is ever true, when checked, the interaction attempt with return early with a result of false- Returns:
- True if the entity was clicked, false otherwise
-
-