Very nice work using Auto Hotkey and Glovepie:
Thanks to TylerK from WiiLi.org for this!
First of all, let me just say that this serves no purpose other than just seeing if it could be done. The methods used are far from optimal and I know I already said this in the topic, but I just can’t believe this works!
Lately I’ve been experimenting with combining GlovePIE with another piece of scripting software: AutoHotKey. While similar to GlovePIE in some ways, AHK has a lot of functionality GlovePIE does not. Like the ability to check the color of certain pixels on the screen or to even check if a certain image appears within a certain area of the screen. I’m hoping to utilize this functionality in concert with GlovePIE to make scripts that adapt to what is happening in applications and/or games.
For example, say you have Super Mario Bros. loaded up in an NES emulator. You can use AHK to check the area of the screen that shows how many lives you have and then move the mouse to coordinates based on that number (set the mouse x to 4 if you have 4 lives, set it to 3 if you have 3 lives, etc) and THEN in GlovePIE you can check where the current mouse cursor is. If GlovePIE detects that the mouse’s x position is 4, it can then light up the LEDs on the Wiimote to correspond with how many lives you have left! At least, this is my theory.
Before digging into the meat of it, I decided to test the theory on something easier: Winamp. For this experiment we’ll be using the default Winamp skin, as seen here:

Note that this method will only work with the default skin.
Okay, see that little area right below the track time with the colored bars? These indicate the frequency. The bar furthest to the left is usually triggered by the lowest frequencies, so this is what we will look at to trigger the Wiimote rumble. I have AHK check a coordinate towards the top of the leftmost bar to see if it’s a certain color, and if it is, move the mouse to point 0,0 on the screen and then move it away quickly. Meanwhile a GlovePIE script is constantly checking to see if the mouse is at 0,0 and if it is, it triggers the rumble.
So basically, whenever there’s a lot of bass in Winamp, the Wiimote will rumble!
You can download the compiled AHK script here. When you run it, it will show up in the system tray on the bottom right of your screen. You can close it by right clicking on it and selecting “Exit”. Next you should run the following GlovePIE script:
| Code: |
| if ((Mouse.x == 0) and (Mouse.y==0)) then Wiimote.Rumble = true; wait 20 ms; Wiimote.Rumble = false; endif |
Okay, now open Winamp and make sure it’s using the default skin. After that, open up an mp3 and play it. It will only work if the main Winamp window has focus. If you find it hard to stop Winamp once the script is running because it keeps moving the mouse to the upper left corner, press “V” to stop the track in Winamp.
Again, this is just a little experiment that I cobbled together and I can’t imagine anyone would use this for more than a minute but I thought it was kinda neat and worth sharing.
RSS feed for comments on this post · TrackBack URI
Leave a reply