Don't you think you should make it a little easier to read, and add some comments. Nobody can really learn from that. Also, [code] tags would be nice, and then the script and the post, won't get mixed up.
EDIT: It'd also be nice to have a video of the script working. Don't you agree?