Jump to content

Bind OS Mouse to OSBot Mouse?


Recommended Posts

Posted (edited)

I guess you could use sockets for infomation on client state, osbot api for loaction on screen and java robot for mouse input. 

https://docs.oracle.com/javase/7/docs/api/java/awt/Robot.html

 

 

Here are some networrking codes.

@dreameo

https://gist.github.com/DreamLean/61b215bad3c8f839ac4c84536d67c804

 

 

[This dumb tbh just use the osbot api for the mouse]

Edited by Nbacon
Posted
26 minutes ago, Nbacon said:

I guess you could use sockets for infomation on client state, osbot api for loaction on screen and java robot for mouse input. 

https://docs.oracle.com/javase/7/docs/api/java/awt/Robot.html

 

 

Here are some networrking codes.

@dreameo

https://gist.github.com/DreamLean/61b215bad3c8f839ac4c84536d67c804

 

 

[This dumb tbh just use the osbot api for the mouse]

OSBot doesn't allow Robot 

  • Heart 1
Posted (edited)
1 hour ago, Naked said:

OSBot doesn't allow Robot 

Thats what the sockets were for. 

To emend my first post. make 2 porgrams one for osbot and the other that runs natively on your computer. Connect them with sockets.

Edit: everthing has a work around and osbot does not block Runtime.getRuntime().exec("some command line shit here") 

Just an example. I think it does not even need to be in the osbot data file.

@ScriptManifest(
        author = "Bacon",
        name = "TestScript",
        info = "",
        version = 0.0D,
        logo = ""
)


public class TestScript extends Script {

    @Override
    public int onLoop() throws InterruptedException {

        try {
            Runtime.getRuntime().exec("java -jar /home/USER/OSBot/Data/test/RuneLite.jar");
        } catch (IOException e) {
            e.printStackTrace();
        }

        return 60000;
    }
}

 

Edit 2

On linux do this "sudo apt-get install xdotool". and this skript moved my mouse around 

https://stackoverflow.com/questions/20595716/control-mouse-by-writing-to-dev-input-mice

    @Override
    public int onLoop() throws InterruptedException {

        try {

            for (int i = 0; i < 10; i++) {
                Runtime.getRuntime().exec("xdotool mousemove "+random(0,1000)+" "+random(0,1000));
                Thread.sleep(1000);
            }

        } catch (IOException e) {
            e.printStackTrace();
        }

        return 60000;
    }

 

 

 

 

 

 

 

 

 

 

 

Edited by Nbacon

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...