Sign in to follow this  
Followers 0
Cornflake

Recording Keystrokes

11 posts in this topic

I have a game I play, and I was curious if there was anyway I would record keystrokes and use autoit to come back and play these keys for me.

I guess Im looking for a program that could record what I do, then display to me what keys I pressed as well as the time inbetween the pressing of the keys (in milliseconds).

Anyone know of such a script or program?

Share this post


Link to post
Share on other sites



You can make a script. I would recommend the UDFs _IsKeyPressed() and the timer functions in AutoIT. TimerInit() I believe and TimerDiff()...I could be wrong...no helpfile on this computer.

Share this post


Link to post
Share on other sites

There's been keyloggers but they are frowned apon, and as far as I know there's been none with 'Timers'. Sounds like a fun UDF you could start on though.


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

write it to ini or something.

With _ispressed is possible but you need to scan for all buttons.

wich means a large for loop wich looks for all keys.

Maybe there is a better way for calling user32.dll so it returns the key used (wich would work better(simpler))

The basic program would be a loop

one variable wich indicates a record has started (wich would be smart to put under some key combo) then only start recording after the first button is pressed (so no weird delay when playing the key sequence)

when its recording it should save a timerinit everytime a button is pressed. at that moment also save the buttoncode.

Save both to some file or array.

then restart the loop

and also have a key combo for stopping the record.

The playing would be easy just a while loop wich reads the variable or ini file and sleep the amount of ms wich were stored and play the button wich was saved (so need to translate the key codes to keys)

Also be shure to keep the order right so the delay is in front of the key send otherwise the wrong delay (of the previous ) would be used

Share this post


Link to post
Share on other sites

I tried your suggestion just for fun Spacely... It does in fact work.


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Kewl, I was to lazy to try it because i'd had to translate all those keys

Share this post


Link to post
Share on other sites

I cheated... grabbed one that was already done :P


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Another something that I think may have been over looked, is to use SciTE's built-in AutoItMacroGenerator. Use that and it should help in your building of a script.

Also the above methods are just creating your own basically.

In SciTE there are two or three different macro recorders.

JS


AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Share this post


Link to post
Share on other sites

Another something that I think may have been over looked, is to use SciTE's built-in AutoItMacroGenerator. Use that and it should help in your building of a script.

Also the above methods are just creating your own basically.

In SciTE there are two or three different macro recorders.

JS

I was going to say that JS, but I don't remember any of them having timers or 'key presses' which would make them basically Null and Void for the topic.


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

I was going to say that JS, but I don't remember any of them having timers or 'key presses' which would make them basically Null and Void for the topic.

I thought I remembered one having the key's (using _IsPressed()). Now the timers would then have to just be added to the code. It wouldnt be that hard. I am pretty sure the source comes with all of them.

JS


AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Share this post


Link to post
Share on other sites

Windows v3.1 came with a utility called 'Recorder' which did precisely this. I wonder why it was never released with Windows 95+?

Actually, I wonder if it's available on the 'Net somewhere and whether it would indeed work with newer OSes if downloaded...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0