well, if you can't program (like me, I'm trying to change that) u can try a program.
It's shareware, so if it works u have to buy it ($79.95). U can check it out for a free trial here:
http://www.webattack.com/get/automate.shtml .

I don't remember if it was this prog that I used a few years ago, but it seems to be the same, and u have a lot of options to automate tasks. ( even if u can't do it fully automated, u can do it like: "move mouse to x,y ; click left mouse button; etc.. doing like this, it can't be anyone on the server while the task is executing, which it seems not to be a problem).

well, try it see if it works.

Thats all the help I can give u right now.