Class InteractionEvent
- java.lang.Object
-
- org.dreambot.api.input.event.AbstractEvent
-
- org.dreambot.api.input.event.impl.mouse.AbstractMouseEvent
-
- org.dreambot.api.input.event.impl.mouse.impl.MoveEvent<AbstractMouseDestination>
-
- org.dreambot.api.input.event.impl.InteractionEvent
-
- All Implemented Interfaces:
java.lang.Runnable
public class InteractionEvent extends MoveEvent<AbstractMouseDestination>
Created by Chris on 2/22/2015.
-
-
Constructor Summary
Constructors Constructor Description InteractionEvent(AbstractMouseDestination destination)
Instantiates a new Interaction event.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Condition
failed()
AbstractCondition
used to determine if current event has failed.Condition
getInterrupt()
static int
getMaxRetryAttempts()
boolean
interact()
Interacts with the given object.boolean
interact(java.lang.String action)
Interacts with the given object using an action.boolean
interact(java.lang.String action, boolean right, boolean forceRight)
Interacts with the given object using an action.boolean
interact(java.lang.String action, InteractionSetting... settings)
Interacts with the given object using an action.boolean
interactForceLeft(java.lang.String action)
Interacts with current object by forcing a left click.boolean
interactForceRight(java.lang.String action)
Interacts with the current object by forcing a left right.boolean
isHoverOnly()
void
setHoverOnly(boolean hoverOnly)
void
setInterrupt(Condition c)
static void
setMaxRetryAttempts(int maxRetryAttempts)
void
stop()
Kills the current interaction event instance.-
Methods inherited from class org.dreambot.api.input.event.impl.mouse.impl.MoveEvent
completed, run, runMiddleDrag, setCompleted, setFailed
-
Methods inherited from class org.dreambot.api.input.event.impl.mouse.AbstractMouseEvent
getDestination, setDestination
-
-
-
-
Constructor Detail
-
InteractionEvent
public InteractionEvent(AbstractMouseDestination destination)
Instantiates a new Interaction event.- Parameters:
destination
- the destination
-
-
Method Detail
-
getInterrupt
public Condition getInterrupt()
-
setInterrupt
public void setInterrupt(Condition c)
-
interactForceLeft
public boolean interactForceLeft(java.lang.String action)
Interacts with current object by forcing a left click. (Interact without using Menus)- Parameters:
action
- the action which to check for before clicking.- Returns:
- the result of the interaction, true if successful, otherwise false.
-
interactForceRight
public boolean interactForceRight(java.lang.String action)
Interacts with the current object by forcing a left right. (Interact using Menus)- Parameters:
action
- the action to use for interacting.- Returns:
- the result of the interaction, true if successful, otherwise false.
-
interact
public boolean interact(java.lang.String action)
Interacts with the given object using an action. Will choose best type interaction, using both left and right clicks.- Parameters:
action
- the action- Returns:
- results of interaction, true if interaction with the object was successful, otherwise false.
-
interact
public boolean interact()
Interacts with the given object. Will choose the best type given the provided arguments.- Returns:
- results of interaction, true if interaction with the object was successful, otherwise false.
-
interact
public boolean interact(java.lang.String action, boolean right, boolean forceRight)
Interacts with the given object using an action. Will choose the best type given the provided arguments.- Parameters:
action
- the actionright
- this will allow usage of right click to interact. (WILL NOT FORCE RIGHT CLICK)forceRight
- the override click type, and forces interaction to use a right click.- Returns:
- results of interaction, true if interaction with the object was successful, otherwise false.
-
interact
public boolean interact(java.lang.String action, InteractionSetting... settings)
Interacts with the given object using an action. Checks interaction settings for specifics on how to interact with the object.- Parameters:
action
- String value of the action to interact with.settings
- Settings to use for specifics on how to interact with the object.- Returns:
- True if interaction is successful, otherwise false.
-
failed
public Condition failed()
Description copied from class:MoveEvent
AbstractCondition
used to determine if current event has failed.- Overrides:
failed
in classMoveEvent<AbstractMouseDestination>
- Returns:
Condition
used to determine if current event has failed.
-
stop
public void stop()
Kills the current interaction event instance.
-
isHoverOnly
public boolean isHoverOnly()
-
setHoverOnly
public void setHoverOnly(boolean hoverOnly)
-
getMaxRetryAttempts
public static int getMaxRetryAttempts()
-
setMaxRetryAttempts
public static void setMaxRetryAttempts(int maxRetryAttempts)
-
-