public class InteractionEvent extends Event
Event.EventMode, Event.EventStatus
bank, camera, chatbox, client, colorPicker, combat, configs, depositBox, dialogues, diaries, display, doorHandler, equipment, experienceTracker, favour, grandExchange, graphicObjects, groundItems, hintArrow, inventory, keyboard, logger, logoutTab, magic, map, menu, mouse, npcs, objects, players, prayer, projectiles, quests, settings, skills, store, tabs, trade, walking, widgets, worlds
Constructor and Description |
---|
InteractionEvent(Bot bot,
Position position,
java.lang.String... actions)
Creates an interaction event which interacts with the specified position.
|
InteractionEvent(Entity entity,
java.lang.String... actions)
Creates an interaction event which interacts with the specified entity.
|
InteractionEvent(MouseDestination destination,
java.lang.String... actions)
Creates an interaction event which interacts with the specified mouse
destination.
|
InteractionEvent(RS2Widget widget,
java.lang.String... actions)
Creates an interaction event which interacts with the specified widget.
|
Modifier and Type | Method and Description |
---|---|
int |
execute()
This is the execution method.
|
boolean |
isHover()
Determines if we're only hovering.
|
void |
onStart()
Called before this event is executed.
|
InteractionEvent |
setAction(java.lang.String... actions)
Sets the action of the menu to interact with.
|
InteractionEvent |
setCameraDistanceThreshold(int cameraDistanceThreshold)
Deprecated.
|
InteractionEvent |
setHover(boolean hover)
Sets whether or not this event will only hover, not click.
|
InteractionEvent |
setMaximumAttempts(int maximumAttempts)
Sets the maximum attempts an InteractionEvent execution can attempt.
|
InteractionEvent |
setName(java.lang.String... names)
Sets the name(s) of the entity or item to interact with.
|
InteractionEvent |
setOpenMenuOnly(boolean openMenuOnly)
Sets whether or not this event will only open the menu, not click.
|
InteractionEvent |
setOperateCamera(boolean operateCamera)
Sets whether it is allowed by this event to operate the camera.
|
InteractionEvent |
setValidateMenuEntity(boolean validateMenuEntity)
Sets the validation that the interaction will be with the exact entity provided.
|
InteractionEvent |
setWalkingDistanceThreshold(int walkingDistanceThreshold)
Sets the maximum distance to the entity for which this event is not
allowed to walk.
|
InteractionEvent |
setWalkTo(boolean walkTo)
Sets whether it is allowed by this event to walk.
|
addChild, exchangeContext, getChildren, getMode, getParent, getStatus, hasFailed, hasFinished, interrupt, isQueued, isWorking, onEnd, removeChild, setAsync, setBlocking, setFailed, setFinished, setParent
execute, getBank, getBot, getCamera, getChatbox, getClient, getColorPicker, getCombat, getConfigs, getDepositBox, getDialogues, getDiaries, getDisplay, getDoorHandler, getEquipment, getExperienceTracker, getFavour, getGrandExchange, getGraphicObjects, getGroundItems, getHintArrow, getInventory, getKeyboard, getLogoutTab, getMagic, getMap, getMenuAPI, getMouse, getNpcs, getObjects, getPlayers, getPrayer, getProjectiles, getQuests, getSettings, getSkills, getStore, getTabs, getTrade, getWalking, getWidgets, getWorlds, gRandom, gRandom, gRandom, initializeContext, log, log, myPlayer, myPosition, random, random, sleep, stripFormatting, warn
public InteractionEvent(Entity entity, java.lang.String... actions)
entity
- The entity to interact with.actions
- The possible menu actions to interact with. None for left
click. The bot attempts to interact with the first action in
the array detected.public InteractionEvent(Bot bot, Position position, java.lang.String... actions)
bot
- The bot instance.position
- The position to interact with.actions
- The possible menu actions to interact with. None for left
click. The bot attempts to interact with the first action in
the array detected.public InteractionEvent(RS2Widget widget, java.lang.String... actions)
widget
- The widget to interact with.actions
- The possible menu actions to interact with. None for left
click. The bot attempts to interact with the first action in
the array detected.public InteractionEvent(MouseDestination destination, java.lang.String... actions)
destination
- The mouse destination to interact with.actions
- The possible menu actions to interact with. None for left
click. The bot attempts to interact with the first action in
the array detected.public InteractionEvent setName(java.lang.String... names)
names
- The name(s) of the entity or item to interact with. The bot
will interact with the first name detected.public InteractionEvent setAction(java.lang.String... actions)
actions
- The possible menu actions to interact with. None for left
click. The bot attempts to interact with the first action in
the array detected.public InteractionEvent setHover(boolean hover)
hover
- True if we're only hovering.public InteractionEvent setOpenMenuOnly(boolean openMenuOnly)
openMenuOnly
- True if we're only opening the menu without clicking an item.public boolean isHover()
public InteractionEvent setOperateCamera(boolean operateCamera)
operateCamera
- True if this event is allowed to operate the camera.public InteractionEvent setWalkTo(boolean walkTo)
walkTo
- True if this event is allowed to walk.public InteractionEvent setMaximumAttempts(int maximumAttempts)
maximumAttempts
- The maximum attempts an InteractionEvent execution can attempt.@Deprecated public InteractionEvent setCameraDistanceThreshold(int cameraDistanceThreshold)
cameraDistanceThreshold
- The camera distance thresholdpublic InteractionEvent setWalkingDistanceThreshold(int walkingDistanceThreshold)
walkingDistanceThreshold
- The maximum distance to the entity for which this event is not
allowed to walk.public InteractionEvent setValidateMenuEntity(boolean validateMenuEntity)
validateMenuEntity
- True to interact with the exact entity providedpublic void onStart()
Event
public int execute() throws java.lang.InterruptedException
Event
onLoop()
in OSBot v1.