Just Google it.
Note that your OSBot scripts may only be clients, your server will have to be a separate program.
There is a tutorial on OSBot, idk how good it is
But theres tonnes of tutorials online on how to make a socket client and server with Java, and it's no different to how you do it with OSBot