Package com.epicbot.api.shared.methods
Interface IMouseAPI
public interface IMouseAPI
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbooleanclick()Clicks the left mouse button.booleanclick(boolean rightClick) Clicks the left or right mouse button.booleanclick(int x, int y) Moves the mouse and clicks at the given x,y coordinates.booleanclick(int x, int y, boolean rightClick) Moves the mouse and clicks at the given x,y coordinates.booleanMoves the mouse and clicks on the given clickable entity.booleanMoves the mouse and clicks on the given clickable entity.booleanMoves the mouse and clicks on the given location.booleanMoves the mouse and clicks on the given location.booleanMoves the mouse and clicks on a random point on the given shape.booleanMoves the mouse and clicks on a random point on the given shape.booleandoubleClick(Point randomPoint) booleanDrags the mouse from the current mouse location to the given location.booleanDrags the mouse to the start location if not already there and drags the mouse to the given end location.booleanDrags the mouse to the start location if not already there and drags the mouse to the given end location.Gets the last known mouse location before it went of screen.Gets the current mouse location.intintintintReturns the base mouse movement speed in milliseconds.intgetX()Gets the current x-coordinate of the mouse.intgetY()Gets the current y-coordinate of the mouse.booleanhold(int duration, boolean rightClick) Holds the left or right mouse button for a duration at the current mouse location.booleanHolds the left or right mouse button for a duration at the given location.booleanbooleanbooleanbooleanMoves the mouse onto the given clickable entity.booleanMoves the mouse to the given location.booleanSimulates moving the mouse off screen.booleanMoves the mouse randomly.booleanmoveRandomly(int maxDistance) Moves the mouse randomly between the maximum distance.booleanmoveRandomly(int minDistance, int maxDistance) Moves the mouse randomly between the two distances.booleanscroll(boolean up) Scrolls the mouse wheel.booleanscroll(boolean up, int times) Scrolls the mouse wheel.voidsetMoveSpeedTime(int speedMs) Set the base mouse movement speed in milliseconds.voidsetX(int x) Sets the x-coordinate of the mouse.voidsetY(int y) Sets the y-coordinate of the mouse.
-
Field Details
-
DEFAULT_SPEED
static final int DEFAULT_SPEED- See Also:
-
-
Method Details
-
isPressed
boolean isPressed() -
isRightPressed
boolean isRightPressed() -
isPresent
boolean isPresent() -
click
boolean click()Clicks the left mouse button.- Returns:
- true if successful, false otherwise
-
click
boolean click(boolean rightClick) Clicks the left or right mouse button.- Parameters:
rightClick- true to use the right mouse button, false otherwise- Returns:
- true if successful, false otherwise
-
click
boolean click(int x, int y) Moves the mouse and clicks at the given x,y coordinates.- Parameters:
x- the x-coordinate to move toy- the y-coordinate to move to- Returns:
- true if successful, false otherwise
-
click
boolean click(int x, int y, boolean rightClick) Moves the mouse and clicks at the given x,y coordinates.- Parameters:
x- the x-coordinate to move toy- the y-coordinate to move torightClick- true to use the right mouse button, false otherwise- Returns:
- true if successful, false otherwise
-
click
Moves the mouse and clicks on a random point on the given shape.- Parameters:
shape- the shape to click on- Returns:
- true if successful, false otherwise
-
click
Moves the mouse and clicks on a random point on the given shape.- Parameters:
shape- the shape to click onrightClick- true to use the right mouse button, false otherwise- Returns:
- true if successful, false otherwise
-
click
Moves the mouse and clicks on the given location.- Parameters:
location- the location- Returns:
- true if successful, false otherwise
-
click
Moves the mouse and clicks on the given location.- Parameters:
location- the locationrightClick- true to use the right mouse button, false otherwise- Returns:
- true if successful, false otherwise
-
doubleClick
-
hold
boolean hold(int duration, boolean rightClick) Holds the left or right mouse button for a duration at the current mouse location.- Parameters:
duration- the duration to hold forrightClick- true to use the right mouse button, false otherwise- Returns:
- true if successful, false otherwise
-
hold
Holds the left or right mouse button for a duration at the given location.- Parameters:
location- the location to hold the mouse button atduration- the duration to hold forrightClick- true to use the right mouse button, false otherwise- Returns:
- true if successful, false otherwise
-
move
Moves the mouse to the given location.- Parameters:
location- the location- Returns:
- true if successful, false otherwise
-
moveOffScreen
boolean moveOffScreen()Simulates moving the mouse off screen.- Returns:
- true if successful, false otherwise
-
moveRandomly
boolean moveRandomly()Moves the mouse randomly.- Returns:
- true if successful, false otherwise
-
moveRandomly
boolean moveRandomly(int maxDistance) Moves the mouse randomly between the maximum distance.- Parameters:
maxDistance- The maximum distance to move.- Returns:
- true if successful, false otherwise
-
moveRandomly
boolean moveRandomly(int minDistance, int maxDistance) Moves the mouse randomly between the two distances.- Parameters:
minDistance- The minimum distance to move.maxDistance- The maximum distance to move.- Returns:
- true if successful, false otherwise
-
scroll
boolean scroll(boolean up) Scrolls the mouse wheel.- Parameters:
up- true to scroll up, false to scroll down- Returns:
- true if successful, false otherwise
-
scroll
boolean scroll(boolean up, int times) Scrolls the mouse wheel.- Parameters:
up- true to scroll up, false to scroll downtimes- the number of times the scroll wheel should be rolled- Returns:
- true if successful, false otherwise
-
drag
Drags the mouse from the current mouse location to the given location.- Parameters:
end- the location to stop dragging at- Returns:
- true if successful, false otherwise
-
drag
Drags the mouse to the start location if not already there and drags the mouse to the given end location.- Parameters:
start- the location to start dragging atend- the location to stop dragging at- Returns:
- true if successful, false otherwise
-
drag
Drags the mouse to the start location if not already there and drags the mouse to the given end location.- Parameters:
start- the location to start dragging atend- the location to stop dragging atbutton- the mouse button to hold during the operation, seeMouseEvent, defaults to left-click button (MouseEvent.BUTTON1)- Returns:
- true if successful, false otherwise
-
getX
int getX()Gets the current x-coordinate of the mouse.- Returns:
- the x-coordinate or -1 if the mouse is not present
-
getY
int getY()Gets the current y-coordinate of the mouse.- Returns:
- the y-coordinate or -1 if the mouse is not present
-
setX
void setX(int x) Sets the x-coordinate of the mouse. -
setY
void setY(int y) Sets the y-coordinate of the mouse. -
getLocation
Point getLocation()Gets the current mouse location.- Returns:
Point- See Also:
-
getLastLocation
Point getLastLocation()Gets the last known mouse location before it went of screen.- Returns:
Point
-
getMoveSpeedTime
int getMoveSpeedTime()Returns the base mouse movement speed in milliseconds.- Returns:
- milliseconds
-
setMoveSpeedTime
void setMoveSpeedTime(int speedMs) Set the base mouse movement speed in milliseconds.- Parameters:
speedMs- base move time in milliseconds
-
getMouseCrossX
int getMouseCrossX() -
getMouseCrossY
int getMouseCrossY() -
getMouseCrossColor
IMouseAPI.CrossColor getMouseCrossColor() -
getMouseCrossState
int getMouseCrossState()
-