Here's something I quickly hacked up, it's very very simple.
http://apo123.pastebin.com/d5f4ec7d
JDK 1.6 and JRE 6
First set the mouse X and Y to be within the window of whatever emulator you're using (this should work for any emulator if the controls are modified accordingly). You can use the Test Mouse button to move the mouse to those X and Y coordinates to see where it'll end up.
Modify the code within mainloop() to do whatever actions you want the bot to perform. You will probably have to modify the key values to match your controls.
First, modify the loadState() function to match whichever savestate you want to be loading.
Frames go like this:
doFrame(CONTROLS)
For example, to hold left and X for one frame, just do:
doFrame(LEFT, X)
Keys are reset to none every frame.
Leaving it null just advances one frame without sending any keys.
incrementedFrame()'s first parameter tells it how many times to run. I've built in a counter to increment, so if you wanted to test an attack on every frame just do this:
// Wait counter frames
incrementedFrame(counter);
// Hit X to attack
doFrame(X);
// Wait one second so the damage appears and can be recorded
incrementedFrame(60);
You may modify the body of incrementedFrame as you wish.
After mainloop() is run, the mouse will move back to where it was when you clicked the button.
Sorry about the GUI, this was my first time using Swing.
Feel free to modify this as you wish.
If you don't feel comfortable modifying the code/mainloop and want a specific set of commands to be hardcoded, or just want part of the code modified, let me know via PM.