Package rsb.methods
Class Mouse
java.lang.Object
rsb.methods.MethodProvider
rsb.methods.Mouse
Mouse related operations.
-
Field Summary
Fields inherited from class rsb.methods.MethodProvider
methods
-
Method Summary
Modifier and TypeMethodDescriptionvoid
click
(boolean leftClick) Clicks the mouse at its current location.void
click
(boolean leftClick, int moveAfterDist) void
click
(int x, int y, boolean leftClick) Moves the mouse to a given location then clicks.void
click
(int x, int y, int randX, int randY, boolean leftClick) Moves the mouse to a given location with given randomness then clicks.void
click
(int x, int y, int randX, int randY, boolean leftClick, int moveAfterDist) Moves the mouse to a given location with given randomness then clicks, then moves a random distance up toafterOffset
.void
click
(net.runelite.api.Point p, boolean leftClick) Moves the mouse to a given location then clicks.void
click
(net.runelite.api.Point p, int x, int y, boolean leftClick) void
click
(net.runelite.api.Point p, int x, int y, boolean leftClick, int moveAfterDist) Moves the mouse to a given location with given randomness then clicks, then moves a random distance up toafterOffset
.void
Moves the mouse slightly depending on where it currently is and clicks.void
drag
(int x, int y) Drag the mouse from the current position to a certain other position.void
drag
(net.runelite.api.Point p) Drag the mouse from the current position to a certain other position.net.runelite.api.Point
The location of the bot's mouse; or Point(-1, -1) if off screen.net.runelite.api.Point
long
int
getRandomX
(int maxDistance) int
getRandomY
(int maxDistance) int
getSpeed()
Gets the mouse speed.void
hop
(int x, int y) Hops mouse to the specified coordinate.void
hop
(int x, int y, int randX, int randY) Hops mouse to the certain coordinate.void
hop
(net.runelite.api.Point p) Hops mouse to the specified point.void
hop
(net.runelite.api.Point p, int randX, int randY) Hops mouse to the certain point.boolean
boolean
void
move
(int x, int y) Moves mouse to location (x,y) at default speed.void
move
(int x, int y, int afterOffset) Moves the mouse to the specified point and then by a randomized offset at default speed.void
move
(int x, int y, int randX, int randY) Moves the mouse to the specified point with a randomized variation at default speed.void
move
(int speed, int x, int y, int randX, int randY) Moves the mouse to the specified point at a certain speed.void
move
(int speed, int x, int y, int randX, int randY, int afterOffset) Moves the mouse to the specified point at a certain speed with variance in the x and y, then moves a random distance up toafterOffset
.void
move
(int speed, net.runelite.api.Point p) Moves the mouse to the specified point at a certain speedvoid
move
(net.runelite.api.Point p) Moves the mouse to the specified pointvoid
move
(net.runelite.api.Point p, int afterOffset) Moves the mouse to the specified point then adds random distance up toafterOffset
.void
move
(net.runelite.api.Point p, int randX, int randY) Moves the mouse to the specified point then adds random distance within to randX and randYvoid
move
(net.runelite.api.Point p, int randX, int randY, int afterOffset) Moves the mouse to the specified point at a certain speed with variance in the x and y, then moves a random distance up toafterOffset
.void
Moves the mouse off the screen in a random direction.void
moveRandomly
(int maxDistance) Author - Enfilade Moves the mouse a random distance between 1 and maxDistance from the current position of the mouse by generating a random vector and then multiplying it by a random number between 1 and maxDistance.void
moveRandomly
(int minDistance, int maxDistance) Author - Enfilade Moves the mouse a random distance between minDistance and maxDistance from the current position of the mouse by generating random vector and then multiplying it by a random number between minDistance and maxDistance.void
Moves the mouse slightly depending on where it currently is.void
setSpeed
(int speed) Changes the mouse speed
-
Method Details
-
moveRandomly
public void moveRandomly(int maxDistance) Author - Enfilade Moves the mouse a random distance between 1 and maxDistance from the current position of the mouse by generating a random vector and then multiplying it by a random number between 1 and maxDistance. The maximum distance is cut short if the mouse would go off screen in the direction it chose.- Parameters:
maxDistance
- The maximum distance the cursor will move (exclusive)
-
moveRandomly
public void moveRandomly(int minDistance, int maxDistance) Author - Enfilade Moves the mouse a random distance between minDistance and maxDistance from the current position of the mouse by generating random vector and then multiplying it by a random number between minDistance and maxDistance. The maximum distance is cut short if the mouse would go off screen in the direction it chose.- Parameters:
minDistance
- The minimum distance the cursor will movemaxDistance
- The maximum distance the cursor will move (exclusive)
-
moveOffScreen
public void moveOffScreen()Moves the mouse off the screen in a random direction. -
drag
public void drag(int x, int y) Drag the mouse from the current position to a certain other position.- Parameters:
x
- The x coordinate to drag to.y
- The y coordinate to drag to.
-
drag
public void drag(net.runelite.api.Point p) Drag the mouse from the current position to a certain other position.- Parameters:
p
- The point to drag to.- See Also:
-
click
public void click(boolean leftClick) Clicks the mouse at its current location.- Parameters:
leftClick
-true
to left-click,false
to right-click.
-
click
public void click(boolean leftClick, int moveAfterDist) -
click
public void click(int x, int y, boolean leftClick) Moves the mouse to a given location then clicks.- Parameters:
x
- x coordinatey
- y coordinateleftClick
-true
to left-click,false
to right-click.
-
click
public void click(int x, int y, int randX, int randY, boolean leftClick) Moves the mouse to a given location with given randomness then clicks.- Parameters:
x
- x coordinatey
- y coordinaterandX
- x randomness (added to x)randY
- y randomness (added to y)leftClick
-true
to left-click,false
to right-click.- See Also:
-
click
public void click(int x, int y, int randX, int randY, boolean leftClick, int moveAfterDist) Moves the mouse to a given location with given randomness then clicks, then moves a random distance up toafterOffset
.- Parameters:
x
- x coordinatey
- y coordinaterandX
- x randomness (added to x)randY
- y randomness (added to y)leftClick
-true
to left-click,false
to right-click.moveAfterDist
- The maximum distance in pixels to move on both axes shortly after moving to the destination.
-
click
public void click(net.runelite.api.Point p, boolean leftClick) Moves the mouse to a given location then clicks.- Parameters:
p
- The point to click.leftClick
-true
to left-click,false
to right-click.
-
click
public void click(net.runelite.api.Point p, int x, int y, boolean leftClick) -
click
public void click(net.runelite.api.Point p, int x, int y, boolean leftClick, int moveAfterDist) Moves the mouse to a given location with given randomness then clicks, then moves a random distance up toafterOffset
.- Parameters:
p
- The destination Point.x
- x coordinatey
- y coordinateleftClick
-true
to left-click,false
to right-click.moveAfterDist
- The maximum distance in pixels to move on both axes shortly after moving to the destination.
-
clickSlightly
public void clickSlightly()Moves the mouse slightly depending on where it currently is and clicks. -
getSpeed
public int getSpeed()Gets the mouse speed.- Returns:
- the current mouse speed.
- See Also:
-
setSpeed
public void setSpeed(int speed) Changes the mouse speed- Parameters:
speed
- The speed to move the mouse at. 4-10 is advised, 1 being the fastest.- See Also:
-
move
public void move(int x, int y) Moves mouse to location (x,y) at default speed.- Parameters:
x
- x coordinatey
- y coordinate- See Also:
-
move
public void move(int x, int y, int afterOffset) Moves the mouse to the specified point and then by a randomized offset at default speed.- Parameters:
x
- The x destination.y
- The y destination.afterOffset
- The maximum distance in pixels to move on both axes shortly after moving to the destination.- See Also:
-
move
public void move(int x, int y, int randX, int randY) Moves the mouse to the specified point with a randomized variation at default speed.- Parameters:
x
- The x destination.y
- The y destination.randX
- x-axis randomness (added to x).randY
- y-axis randomness (added to y).- See Also:
-
move
public void move(int speed, int x, int y, int randX, int randY) Moves the mouse to the specified point at a certain speed.- Parameters:
speed
- The lower, the faster.x
- The x destination.y
- The y destination.randX
- x-axis randomness (added to x).randY
- y-axis randomness (added to y).- See Also:
-
move
public void move(int speed, int x, int y, int randX, int randY, int afterOffset) Moves the mouse to the specified point at a certain speed with variance in the x and y, then moves a random distance up toafterOffset
.- Parameters:
speed
- The lower, the faster.x
- The x destination.y
- The y destination.randX
- X-axis randomness (added to x).randY
- X-axis randomness (added to y).afterOffset
- The maximum distance in pixels to move on both axes shortly after moving to the destination.
-
move
public void move(int speed, net.runelite.api.Point p) Moves the mouse to the specified point at a certain speed- Parameters:
speed
- The lower, the faster.p
- The x and y destination.
-
move
public void move(net.runelite.api.Point p) Moves the mouse to the specified point- Parameters:
p
- The x and y destination.
-
move
public void move(net.runelite.api.Point p, int afterOffset) Moves the mouse to the specified point then adds random distance up toafterOffset
.- Parameters:
p
- The x and y destination.afterOffset
- The maximum distance in pixels to move on both axes shortly after moving to the destination.
-
move
public void move(net.runelite.api.Point p, int randX, int randY) Moves the mouse to the specified point then adds random distance within to randX and randY- Parameters:
p
- The x and y destination.randX
- X-axis randomness (added to x).randY
- X-axis randomness (added to y).
-
move
public void move(net.runelite.api.Point p, int randX, int randY, int afterOffset) Moves the mouse to the specified point at a certain speed with variance in the x and y, then moves a random distance up toafterOffset
.- Parameters:
p
- The x and y destination.randX
- X-axis randomness (added to x).randY
- X-axis randomness (added to y).afterOffset
- The maximum distance in pixels to move on both axes shortly after moving to the destination.
-
hop
public void hop(int x, int y) Hops mouse to the specified coordinate.- Parameters:
x
- The x coordinate.y
- The y coordinate
-
hop
public void hop(net.runelite.api.Point p) Hops mouse to the specified point.- Parameters:
p
- The coordinate point.- See Also:
-
hop
public void hop(int x, int y, int randX, int randY) Hops mouse to the certain coordinate.- Parameters:
x
- The x coordinate.y
- The y coordinate.randX
- The x coordinate randomization.randY
- The y coordinate randomization.- See Also:
-
hop
public void hop(net.runelite.api.Point p, int randX, int randY) Hops mouse to the certain point.- Parameters:
p
- The coordinate point.randX
- The x coordinate randomization.randY
- The y coordinate randomization.- See Also:
-
moveSlightly
public void moveSlightly()Moves the mouse slightly depending on where it currently is. -
getRandomX
public int getRandomX(int maxDistance) - Parameters:
maxDistance
- The maximum distance outwards.- Returns:
- A random x value between the current client location and the max distance outwards.
-
getRandomY
public int getRandomY(int maxDistance) - Parameters:
maxDistance
- The maximum distance outwards.- Returns:
- A random y value between the current client location and the max distance outwards.
-
getLocation
public net.runelite.api.Point getLocation()The location of the bot's mouse; or Point(-1, -1) if off screen.- Returns:
- A
Point
containing the bot's mouse's x and y coordinates.
-
getPressLocation
public net.runelite.api.Point getPressLocation()- Returns:
- The
Point
at which the bot's mouse was last clicked.
-
getPressTime
public long getPressTime()- Returns:
- The system time when the bot's mouse was last pressed.
-
isPresent
public boolean isPresent()- Returns:
true
if the bot's mouse is present.
-
isPressed
public boolean isPressed()- Returns:
true
if the bot's mouse is pressed.
-