Jump to content

Recording Keystrokes


 Share

Recommended Posts

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?

Link to comment
Share on other sites

  • Moderators

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.

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.

Link to comment
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

Link to comment
Share on other sites

  • Moderators

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

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.

Link to comment
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)

Link to comment
Share on other sites

  • Moderators

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.

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.

Link to comment
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)

Link to comment
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...

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...