google around for a keyboard+mouse recorder and script playback tool, a lot of gamers use this kind of thing to run their in game gold farming bots.
install the tool, record how YOU manually do what you want, test the playback works as you want, then make that tool+script part of your startup...