Automating keystrokes is a fun way to spend an afternoon. It’s also an entertaining to wrap your head around the idea of loops and variables. If you’re wanting extra practice, give these a try.
Note: You’ll need AutoHotkey installed for this. If you don’t know what that is, click here.
Important Commands to Note:
run, Name of Program.exe
SendInput Keystrokes to Send
Sleep, Delay in Milliseconds
Loop, # of times to run loop
{
Commands to run
}
All Work and No Play
Take a look at this code.
run, notepad.exe
Loop, 100
{
SendInput All Work And No Play Makes Jack A Dull Boy.
}
return
Keep in mind that everything inside the loop will happen 100 times, so with just 6 lines of code, you can make the computer type this sentence over and over again. In action, it kind of makes your computer seem possessed.
Continue reading “AHK: How to Lose Friends & Alienate People with Code”