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.

when mouse is clicked?

Featured Replies



if (mouse.getListener().mouseClicked()) {


}


not quite sure what I'm doing wrong here..

 

Add this to your onStart() method

	bot.addMouseListener(new MouseListener() {

	    @Override
	    public void mouseReleased(MouseEvent e) {

	    }

	    @Override
	    public void mousePressed(MouseEvent e) {
		
	    }

	    @Override
	    public void mouseExited(MouseEvent e) {

	    }

	    @Override
	    public void mouseEntered(MouseEvent e) {

	    }

	    @Override
	    public void mouseClicked(MouseEvent e) {
		
	    }
	});

You should implement MouseListener

public class YOUR_CLASS_NAME extends Script implements MouseListener

I believe your main class which extends the "Script" class already has a Mouselistener implemented.

I never had to implement it before..

Oh, didn't know that.

 

Either way, both methods will work.

 

not quite sure what I'm doing wrong here..

 

 

 

	bot.addMouseListener(new MouseListener() {

	    @Override
	    public void mouseReleased(MouseEvent e) {

	    }

	    @Override
	    public void mousePressed(MouseEvent e) {
		
	    }

	    @Override
	    public void mouseExited(MouseEvent e) {

	    }

	    @Override
	    public void mouseEntered(MouseEvent e) {

	    }

	    @Override
	    public void mouseClicked(MouseEvent e) {
		
	    }
	});

 

 

If you just want to capture the users' mouse click you can use the MouseAdapter class

 

(Add this to onStart())

getBot().addMouseListener(new MouseAdapter() {
    @Override
    public void mouseClicked(MouseEvent e) {
        super.mouseClicked(e);
        // do whatever you want to do when the user clicks the mouse
    }
});

Edited by Explv

  • Author

 

Add this to your onStart() method

	bot.addMouseListener(new MouseListener() {

	    @Override
	    public void mouseReleased(MouseEvent e) {

	    }

	    @Override
	    public void mousePressed(MouseEvent e) {
		
	    }

	    @Override
	    public void mouseExited(MouseEvent e) {

	    }

	    @Override
	    public void mouseEntered(MouseEvent e) {

	    }

	    @Override
	    public void mouseClicked(MouseEvent e) {
		
	    }
	});

 

Thanks much! ^.^

 

 

If you just want to capture the users' mouse click you can use the MouseAdapter class

 

(Add this to onStart())

getBot().addMouseListener(new MouseAdapter() {
    @Override
    public void mouseClicked(MouseEvent e) {
        super.mouseClicked(e);
        // do whatever you want to do when the user clicks the mouse
    }
});

 

You're the man, so just to get this straight.. Listener looks for bot 'onClick', while the Adapter handles the humans 'onClick'?

  • Author

They both handles human input, not the scripts input

 

Alright, coolio!

Thanks Khal~

There's currently no clean method to track bot clicks.

 

 

Alright, coolio!

Thanks Khal~

 

I haven't actually tested this out, but this may work for tracking clicks made by the bot:

getBot().addMouseListener(new BotMouseListener() {
    @Override
    public boolean blockInput(Point point) {
        return false;
    }

    @Override
    public void mouseClicked(MouseEvent e) {

    }

    @Override
    public void mousePressed(MouseEvent e) {

    }

    @Override
    public void mouseReleased(MouseEvent e) {

    }

    @Override
    public void mouseEntered(MouseEvent e) {

    }

    @Override
    public void mouseExited(MouseEvent e) {

    }
});

 

I haven't actually tested this out, but this may work for tracking clicks made by the bot:

getBot().addMouseListener(new BotMouseListener() {
    @Override
    public boolean blockInput(Point point) {
        return false;
    }

    @Override
    public void mouseClicked(MouseEvent e) {

    }

    @Override
    public void mousePressed(MouseEvent e) {

    }

    @Override
    public void mouseReleased(MouseEvent e) {

    }

    @Override
    public void mouseEntered(MouseEvent e) {

    }

    @Override
    public void mouseExited(MouseEvent e) {

    }
});

 

nope

Create an account or sign in to comment

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.