Did you ever had to press a key in every couple of seconds, or every few minutes? May be during playing a video game or playing an online game. Here is how you can make your computer do it automatically with just a simple script using AutoHotKey.
First you need to download AutoHotKey, to download AutoHotKey click here.
Once you are done downloading, Right click anywhere on your pc and go to New and select AutoHotKey Script. Name the file and edit it with notepad/notepad++ or any other editor.
Here you will have to write a simple script which will make your computer to press a key every X seconds, X being your defined value.
For example,
I have made a script to play the Hurdles2012 google doodle game.
#Persistent
SetTimer, PressTheKey, 1
Return
PressTheKey:
Send, {Left}
Send, {Right}
Return
Escape::
ExitApp
Return
Here on line number 2 of the program , "1" is in milliseconds. You can change the value to any other numeric value and that will be in milliseconds too. For example, you want your computer to press any key every 5 minutes then in place of one, you will have to write 3,00,000 miliseconds (2minutes*60seconds*1000milliseconds= 3,00,000 milliseconds).
Here Left and Right are the keys of the keyboard which I wanted to be pressed automatically every millisecond.
And Escape will be used to stop the script.
You can also visit the AutoHotKey documentation page for more details and names of the different keys.
No comments:
Post a Comment