Check out the Macros forum. There are a couple of good threads on macros. First one on this thread will give you what your looking for.

http://www.dual-boxing.com/forums2/viewtopic.php?t=1220