Well first off you need to learn a programming language, which one is kind of up to preference but that is what your bot will run from. Java is proffered I believe because Runescape runs off of java as well. The three basic ones that are used are java and visual basic as well as some C++.
Once you know the language you can script it to make it move the mouse or emulate a mouse and keyboard and so on. When you program what you can make is pretty much limitless.