I thought I'd share a bit of code I wrote. Basically this is an Autoit function that tests to see if if your character is currently in the game or not. I wrote it to assist my primary bot which handles logon, logoff and looting while running the Dank Cellar. It will handle windows opening and closing such as the options menu, inventory and even covers porting. Won't handle cut scenes though.
You can download here: [AutoIt] Diablo 3 - AutoIt IsInGame Function - Pastebin.com
I was mostly using it like this:
Code:
While IsInGame()
;Start buffing and running around petting strange creatures.
Wend
I hope you enjoy!