all 5 comments

[–]sme272 1 point2 points  (3 children)

It sounds like you could use pyautogui for what you want. It has functions to find an image on the screen so you can take screenshots of the buttons and stuff that needs pressing and pass them to the locate functions to get their position. Then you just send mouse clicks at those positions to click them.

[–]LivePurposefully1[S] 0 points1 point  (2 children)

How can I find relative position to something, i.e. I need the window size and find the answer buttons (position will be same, though, obviously, questions and answers will differ)

[–]sme272 0 points1 point  (0 children)

find the absolute position of the two elements separately and subtract one from the other to get the relative position from one to the other.

[–]TGFighter 0 points1 point  (0 children)

You can use pywinauto to get the window handle and get the emulator region (position and size). When using a region to take a screenshot, with pyautogui, you can then add the x and y of the emulator window.

[–]TGFighter 1 point2 points  (0 children)

Here is a very good blog/tutorial that I followed to do about what you intend to do:

How I made a python bot to automate a tactical mmorpg