Thursday
Sep092010

Super Simple Button Masher

Lately, I’ve been trying to take advantage of the last few days of my summer vacation by wasting ludicrous amounts of time with wild abandon, something that I doubt I’ll be able to do regularly when I start college in a few days. One of the chief ways I’ve been doing this is playing sublimely idiotic flash games. It was when my trigger finger started to get sore after the first few hours in a marathon gaming session that it’d be extremely easy to write a script to do the clicking for me.

This script is perfect for spray-and-pray, button-mashing type of games. Also, if you ever wondered how someone got that impossibly high score on games like these, it’s not because they have some kind of supernatural button-pressing power (or in the case of the last game, prodigious amounts of patience and free time), it’s because they cheated. After all, even “Master Takahashi”, whose entire claim to fame rests on how well he can button mash, could only reach 16 shots per second at his peak; this script does over 60 per second on my computer.

When I chose to call this “super simple”, I really meant it. This is not meant for more complicated games like WoW (ex. this fishing bot) or Starcraft II. If you’re looking for these kinds of highly specific scripts, check the AutoHotkey forums or better yet, learn to write one yourself. I was so lazy that I didn’t include a GUI or even make a custom logo!

Anyway, without any further ado (oh wait…darn!), here’s the download links.

(Oh, and the even higher scores are from actually hacking the data sent back to the server, not playing the game at all.)

Download

Super Simple Button Masher.exe

Super Simple Button Masher.ahk

Notes:

Microsoft, for security purposes, doesn’t let the script work properly in explorer and IE windows. To get around this, run the program in administrator mode, or better yet, get a better browser.

 

Wednesday
Sep012010

Typing Hanyu Pinyin (Chinese Romanization)

Hi guys,

Some of you guys have asked me to make a Mandarin Chinese version of Spanish_Accents_CapsLock. I’d be happy to, but someone’s already made a really clever little script for that. I really like his implementation, which is very specific to how hanyu pinyin and Chinese works. You just add the tone number right after the word. So you could type “zhong1guo2 shi4 shi4jie4 zui4 hao3 de guo2jia1” and you get “zhōngguó shì shìjiè zuì hǎo de guójiā”. To Chinese speakers this is very intuitive and much better than trying to come up with 4 different hotkeys for each vowel to account for each tone in Chinese.

The only thing that gives me pause in recommending it is that it’s an online solution. While the author’s kept the site running for years, I’m always wary of sites suddenly disappearing from the web. The author provides a download to the PHP script but in order to use it, you’d have to upload it to a server, but most people don’t have access to a spare server. For these people, I’ve made an offline version which CAN be run locally using any old browser. You can find the zip file here. Extract it and open “index.html” in your browser.

All credit goes to to Konrad M. Lawson, who wrote the app, and those who helped him: James Dew, Helmer Aslaksen, C.P. Sobelman, and Phyllis Zhang.

Wednesday
Sep012010

Media Player Classic Pauser

I use Media Player Classic (MPC) to listen to music while I use my computer. I was tired of having to stop typing, grope for my mouse, and hunting down the right MPC window (I normally have at least two or three running at a time). I wrote this simple script that pauses MPC when you press Ctrl+Shift+P even if another windows is active. The script is smart enough to only pause MPC windows that are actually playing, so if you have some other instances of MPC running (but paused) they don’t get unpaused. Press Ctrl+Shift+P again and the last MPC window to be paused will be unpaused. The script supports all versions of Media Player Classic, including the original version by Gabest as well as the newer Home Cinema version.

Download

pause_mpc.exe (program)

pause_mpc.ahk (source code)

Wednesday
Sep012010

Fix Copy-and-Pasting in PDFs

Update (3/30/15): PDF-XChange Viewer is now supported.

Update (10/24/14): I’ve disabled comments due to spam. If you want to contact me, click here.

Update (5/2/11): Major update. See details below.

Update (11/21/2010): Improved version of the script. See details below.

Recently I’ve been reading a lot of ebooks in PDF format so it wasn’t long before I noticed that when you copy text in Adobe Reader (or any other kind of PDF reader like Foxit Reader), it copies the hard returns so if you copy more than one line of text, each line of text is treated like its own paragraph.

 

The Problem

This is what it looks like in Adobe Reader.

This is what happens when you copy that text and paste it into Microsoft Word.

Still good, right? But what if I want to change the font size?

Here I changed the font size of the first two lines to 8-pt. Now you should see the problem quite clearly; in its infinite wisdom, Adobe Reader inserts hard returns instead of soft returns. In other words, Adobe Reader is essentially pressing “Enter/Return” after every line instead of automatically “word wrapping” the text to fit the window size. If this sounds absurdly idiotic, that’s because it is. At first I didn’t know that was the problem until I found this guy’s blog post in a Google search. To give you an idea of how basic “word wrap” is, Notepad has it.

I know I’m not the only one who’s had this problem, and someone even wrote a Word macro. I haven’t tried the macro but it only works with Microsoft Word and it seems overly complicated (it uses well over 100 lines of code and requires a detailed step-by-step installation and usage guide; my script just works out of the box and only uses five nine lines of code (I added support for other PDF readers) [The latest version uses quite a few lines of code, but the vast majority of it is just to add some “nice-to-have” features, especially the automatic quote appending].

The Fix

Download

PDF Copy-Paster.exe (program)

Program Notes

This script strips out all hard returns out of any copied text. Simply keep the program running and it will automatically take out all the hard returns in the background. The program only activates for PDF readers. Currently the program recognizes Adobe Reader (both the standalone program and the browser plugin versions), Foxit Reader, and Sumatra PDF as PDF readers. If your favorite PDF reader isn’t on here, shoot me a quick email and I’ll add it for you.

[Note: The latest version (5/2/11) will close this popup for you automatically] Note that if you press ctrl+c twice quickly, Adobe Reader may pop up a message saying “There was an error while copying to the Clipboard. An internal error occured.” This is likely because Adobe Reader tried to modify the clipboard contents while they were being modified by the script (removing the hard returns). You do not need to copy the text again; everything should work fine.

Update (5/2/11)

I finally made a breakthrough and identified why sometimes the script would stop working and have to be restarted. Turns out it’s an issue with Windows, not anything to do with my code. Anyway, I’ve included a workaround as well as some new features such as an option to automatically add quotes to your copied selections (right click on tray icon to enable) and the ability to left-click on the tray icon to disable or enable the program. The program’s been significantly changed, but most of it is under the hood. The script should now have absolutely no bugs. Of course, if you think you’ve found me, please contact me.

Update (11/21/2010)

I’ve been using this program a lot while writing some big research papers, so I returned to the script to make toggling it more elegant. Now, just press Ctrl+Shift+D to toggle whether the script is active or not. The script’s icon will reflect this change. You no longer need the helper program for this functionality.

Update (9/2/2010)

Helper Program

I wrote this little script for a friend who sometimes wanted to retain the hard returns and sometimes didn’t. It’s not exactly elegant, but it works. Press Ctrl+Shift+d to toggle PDF Copy-Paster. If it’s already running, it will be closed while if it isn’t running, this script will run it.

A few notes

1. This only works for the compiled version of PDF Copy-Paster (the .exe version). Although I am providing a source code version (.ahk), this version also only works with the compiled version of PDF Copy-Paster.

2. This companion script needs to be placed in the same directory as PDF Copy-Paster.exe.

3. I was too lazy to make an icon for this, so it uses the default AHK icons.

Helper Program Download

PDF Copy-Paster Toggler.exe (program)

PDF Copy-Paster Toggler.ahk (source code)

Sunday
Aug222010

Type ©, ®, and ™ easily.

In the same vein as my Spanish_Accents_CapsLock program, this app lets you type common commercial characters by holding down the Caps Lock key.

Hold down Caps Lock and press c to type ©.

Hold down Caps Lock and press r to type ®.

Hold down Caps Lock and press t to type ™.

If you have any suggestions on more common commercial characters for me to include, please let me know. Even if it’s something completely specific to you, chances are I’ll write a custom version for you to use!

Download

Commercial_CapsLock.exe (program)

Commercial_CapsLock.ahk (source code)