I am a great fan of RTS games specially AOE and DOTA. But turns out whenever I start AOE, I always have to put 25 char long CD Key. It really pissed me off and demotivated me from starting the game. But since the game has to go on, I had to find an alternative.

So I searched around to find if there is a way for me to get my system to do this monotonous job for me. I found this library for python which wraps the low level Windows C code. But there was not enough documentation to look around but the function signature is literally same as you would in c#. So I looked at MSDN and found this which clearly explains the use of functions.

I meddled around in python console and came up with this code finally which just worked for me. save it as .pyw file so that the console window doesn't pop up. What it does is waits for 1 sec and then starts pressing the keys on its own at a 0.01s interval. You need to install the win32api library though which i mentioned above for it to work. 

To see it in action, you have to double click the python file and then quickly(within 1s, you can change it though) head over to any window where you could type(eg. notepad) and see the key typed on its own.

I was really proud to get my AOE working hassle free. But then I found out through a senior that it could have been done without that. Just go to properties and run in compatibility mode and type the key for once. It took away all the pride but I was still happy, that atleast I got to learn something, even though it took 2 hrs of my time. But it was worth it!

PS: Well I did it before(maybe a month back) but thought it was worth sharing so did it now.
Taunt21(You'll know if u play AOE :P)

Your comment will be posted after it is approved.


Leave a Reply.