Jump 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.

How To Change Your Script Mouse Cursor

Featured Replies

Finally figured out how to do this and I figured others might want to as well, so here's the code!

 

Put this in your global variable declaration:

public Image cursor;

Have this in your onStart() method:

useDefaultPaint(false);
		
try {
    cursor = ImageIO.read(new URL("YOUR IMAGE URL GOES HERE"));
}
catch (MalformedURLException e) {
    log("Error in retrieving mouse cursor!");
}
catch (IOException e) {
    log("Error in retrieving mouse cursor!");
}

And then finally put this somewhere in your onPaint() method:

int mX = client.getMousePosition().x;
int mY = client.getMousePosition().y;

g.drawImage(cursor, mX, mY, null);

FYI if you use the method moveMouseOutsideScreen() the mouse image you use will appear in the top left of the screen. This is completely normal however it may look a little weird! If you would rather just not have it drawn at all you can do this:

if (mX == -1) {
    //don't draw
}
else {
    //draw
}

Edited by Swizzbeat

  • 2 months later...
int mX = client.getMousePosition().x;

int mY = client.getMousePosition().y;

 

Do both those not just return -1 if the mouse is outside the screen?

  • Author

 

int mX = client.getMousePosition().x;
int mY = client.getMousePosition().y;
 
Do both those not just return -1 if the mouse is outside the screen?

 

Yes, so if the mouse is currently outside of the screen the cursor will appear at the top left of the game window (however it is still technically outside).

Yes, so if the mouse is currently outside of the screen the cursor will appear at the top left of the game window (however it is still technically outside).

But then you can just check if its at (-1, -1) and don't render it when it is, so you don't get the image on the top left :P

  • Author

But then you can just check if its at (-1, -1) and don't render it when it is, so you don't get the image on the top left tongue.png

client.isMouseOutsideScreen() could also be used :p I should probably add that but meh, when I feel like it I will.

Guest
This topic is now closed to further replies.

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

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.