Skip to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Bot Mouse Listener

Featured Replies

I am trying to record mouse movements and clicks generated by the bot. I can record mouse movements easily enough using the getMouse().getPosition()  I am having issues however finding the way to get mouse clicks. Normally this is done implementing a MouseListener interface but everything I can find in the forums relates to listening to  mouse clicks from human input which I can do easily enough.

If your curious as to why I want to do this, its because I want to give my scripts some level of event prediction. What I mean by that is lets say your stringing yew bows... you must have the bank closed before stringing your next set... normally you'd have the bot wait for the window to close and then you'd move the mouse to the inventory to begin those interaction events. A human might begin moving the mouse even before the client knows the bank window is closed. If you could record how the bot is interacting you could playback those recordings in an async thread in much the same way a mouse recorder would, but removing idle mouse movement. 

Any comments or suggestions would be great!

In the situation of closing the bank, and moving the mouse to the inventory before the bank is closed or as soon as you click close. You could just use widgets to get the close button, interact with the widget and right after interacting with no sleeps just move the mouse over to whatever inventory slot you want. Than wait until the interface is closed before interacting with the inventory item.

Edited by BravoTaco

  • Author
5 hours ago, BravoTaco said:

In the situation of closing the bank, and moving the mouse to the inventory before the bank is closed or as soon as you click close. You could just use widgets to get the close button, interact with the widget and right after interacting with no sleeps just move the mouse over to whatever inventory slot you want. Than wait until the interface is closed before interacting with the inventory item.

BravoTaco,

Hey, thanks for your reply. I definitely can come up with solutions to some (or maybe even all) of the issues that I run into in reaction based scripts. I would like to create an elegant solution that would allow the script to record itself, run the recording through an algorithm to smooth out the script, then playback the recording while the script monitors the progress. This could be used anywhere there is repetitive tasks. Imagine runecrafting... the macro could allow the mouse to begin moving to where the alter is even before the player has teleported. A human running runes would do that... 

To make this work though I need to be able to record mouse and keyboard events and therein lies the problem I am trying to solve. 

Edited by gamerboyusbc
grammer

Hmmm, you could create a wrapper for when you use the interact() method, so when the interact() returns true than you know it clicked.

EX.

Might cause problems if the bot had to right click to interact with it though.

private Point interact(Entity entity) {
    Point clickedPoint = null;
    if (entity.interact())
        clickedPoint = getMouse().getPosition();
    return clickedPoint;
}

Edited by BravoTaco

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.