Jump to content

Bind OS Mouse to OSBot Mouse?


jman77

Recommended Posts

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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