One of the very first actually useful programs I wrote was a simple macro program for UO. It would read a text file, parse the very basic commands in the file and then send them to the UO client by finding its HWND via FindWindow and calling SendMessage to send the key presses. I used this to macro easy skills like hiding with scripts like (I don't remember the exact command names now):
STARTLOOP
KEYPRESS F1 // client macro key for hiding skill
WAIT 1000
MOVERANDOM 4 // move 4 times in a random direction to get around server checks for using a skill in the same spot
You wanted to move 8, not 4. Skill gains were made through an 8x8 grid. All the latter skill macros through RunUO were set up for being done on a boat sailing up and down to the east of Moonglow (where you could wrap around the map). They spammed the skill until you got a skill gain, then halted the boat, stepped it forward 8, and tried agian. Rinse and repeat until the 'run' stopped, then resume just moving forward trying until you hit the next run.
STARTLOOP
KEYPRESS F1 // client macro key for hiding skill
WAIT 1000
MOVERANDOM 4 // move 4 times in a random direction to get around server checks for using a skill in the same spot
WAIT 8000
ENDLOOP