A few months ago the internet was all a buzz about TwitchPlaysPokemon. It was an experiment that turned into a phenomenal success. Initially, the stream had a modest following and then it exploded into hundreds of thousands of participants and millions of viewers.

Not too long after, FishPlaysPokemon burst onto the scene. The premise is fairly simple, different locations in the fishes tank are mapped to different keys required to play the GameBoyColor. As the fish swims around it generates random keystrokes in the game.

After seeing the phenomenal amount of attention these projects gathered, I wanted a little bit more information on how similar emulators would work. It was that search that brought me to the weplay repo. This technology allows you to run a GameBoyColor emulator and capture keystrokes all with JavaScript. On their demo site they have Pokemon Yellow set up for anyone to play and test out their library to see how it runs. It is set-up similar to how TwitchPlaysPokemon was set-up. Instead of blocking the chat feature, to move around in the game it uses your keystrokes so you and any number of players can all chat and play at the same time.

After seeing how well the emulator worked; it got me thinking. As an Android Developer I type a lot of words when I'm coding which made me wonder, who would do better at playing Pokemon, me or a fish? I started looking around for some tool or script that would allow me to capture my keystrokes while I'm programming and send them to a Pokemon Yellow game I had open in the browser. After doing some searching I foundout that I can use AutoHotkey (which I already use) to send keystrokes to browser tabs, even in the background. I started playing around with a script and this is what I came up with. It takes my "random" keystrokes from Android Studio and sends them to the minimized IE window opened to weplay.io.