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 TypeMethodDescriptionvoidclick(boolean leftClick) Clicks the mouse at its current location.voidclick(boolean leftClick, int moveAfterDist) voidclick(int x, int y, boolean leftClick) Moves the mouse to a given location then clicks.voidclick(int x, int y, int randX, int randY, boolean leftClick) Moves the mouse to a given location with given randomness then clicks.voidclick(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.voidclick(net.runelite.api.Point p, boolean leftClick) Moves the mouse to a given location then clicks.voidclick(net.runelite.api.Point p, int x, int y, boolean leftClick) voidclick(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.voidMoves the mouse slightly depending on where it currently is and clicks.voiddrag(int x, int y) Drag the mouse from the current position to a certain other position.voiddrag(net.runelite.api.Point p) Drag the mouse from the current position to a certain other position.net.runelite.api.PointThe location of the bot's mouse; or Point(-1, -1) if off screen.net.runelite.api.PointlongintgetRandomX(int maxDistance) intgetRandomY(int maxDistance) intgetSpeed()Gets the mouse speed.voidhop(int x, int y) Hops mouse to the specified coordinate.voidhop(int x, int y, int randX, int randY) Hops mouse to the certain coordinate.voidhop(net.runelite.api.Point p) Hops mouse to the specified point.voidhop(net.runelite.api.Point p, int randX, int randY) Hops mouse to the certain point.booleanbooleanvoidmove(int x, int y) Moves mouse to location (x,y) at default speed.voidmove(int x, int y, int afterOffset) Moves the mouse to the specified point and then by a randomized offset at default speed.voidmove(int x, int y, int randX, int randY) Moves the mouse to the specified point with a randomized variation at default speed.voidmove(int speed, int x, int y, int randX, int randY) Moves the mouse to the specified point at a certain speed.voidmove(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.voidmove(int speed, net.runelite.api.Point p) Moves the mouse to the specified point at a certain speedvoidmove(net.runelite.api.Point p) Moves the mouse to the specified pointvoidmove(net.runelite.api.Point p, int afterOffset) Moves the mouse to the specified point then adds random distance up toafterOffset.voidmove(net.runelite.api.Point p, int randX, int randY) Moves the mouse to the specified point then adds random distance within to randX and randYvoidmove(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.voidMoves the mouse off the screen in a random direction.voidmoveRandomly(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.voidmoveRandomly(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.voidMoves the mouse slightly depending on where it currently is.voidsetSpeed(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-trueto left-click,falseto 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-trueto left-click,falseto 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-trueto left-click,falseto 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-trueto left-click,falseto 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-trueto left-click,falseto 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-trueto left-click,falseto 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
Pointcontaining the bot's mouse's x and y coordinates.
-
getPressLocation
public net.runelite.api.Point getPressLocation()- Returns:
- The
Pointat 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:
trueif the bot's mouse is present.
-
isPressed
public boolean isPressed()- Returns:
trueif the bot's mouse is pressed.
-