rfbplaymacro lets you send keyboard/mouse events to a VNC server, using a script file. The companion program rfbproxy can record scripts for rfbplaymacro to use.
Information regarding Project Releases and Project Resources. Note that the information here is a quote from Freecode.com page, and the downloads themselves may not be hosted on OSDN.