Post Reply 
Thread Rating:
  • 15 Vote(s) - 3.07 Average
  • 1
  • 2
  • 3
  • 4
  • 5
automation via pywinauto
Author Message
fffrune Offline
Junior Member

Posts: 2
Joined: Nov 2016
Reputation: 0
Post: #1
automation via pywinauto


I'm brand new here so I appreciate your patience with my ignorance.

I find that when playing games I perform some tasks very repetitively, and wish that I could automate them so that the computer can do it for me. I like Python and have used pywinauto to automate applications before. However when I try to automate button presses in VBA-M it does not work. When I try to SendKeys (Pywinauto has a thin wrapper around it called TypeKeys) to various panels/objects (I'm not experienced with wx), says that either "the control is not enabled" or it does nothing.

I have also tried it on a previous version, VBA-M878, no luck there either. There is only one panel/object there, and when I SendKeys/TypeKeys nothing happens.

So I'm wondering if anybody has any suggestions on how I can programmatically send keystrokes to the emulator application such that they are recognized as button presses in the game. I'm a confident programmer, so if it's not in Python then I can probably still handle it.


Let me add a little more info: I *can* activate keyboard shortcuts using TypeKeys (when I send 'Ctrl+w' the game closes), but I can't activate buttonpresses (when I send 'x' then it doesn't press the [a] button, even though it is mapped as such). Anybody know why this would be, and how I can get around it?

I was thinking that a potential solution would be to add definable "macros" in the emulator which could be activated via hotkeys. For example, I could define a macro that performs a combo attack (say [down], [left], [b]), and whenever I press Ctrl+Alt+1 it executes that macro. Then I could automate the setup of macros (pywinauto handles windows/popups/dialogs with no problems, for example to open the game I have it press Alt+o then type in the full name of the ROM) and also automate the execution of macros (since keyboard shortcuts seem to work). Of course this would require additional functionality to be built in to the emulator, which I don't want to impose since the developers are probably overloaded already. So it is preferable to instead understand why simple buttonpresses are not working.
(This post was last modified: 11-18-2016 02:32 AM by fffrune.)
11-17-2016 07:12 AM
Find all posts by this user Quote this message in a reply
Post Reply 

Forum Jump:

User(s) browsing this thread: 1 Guest(s)

 Quick Theme: